O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Session-1
Android Introduction
And Its Fundamentals
LEARN. DO. EARN
Course Objectives
2
1. Learn how to develop professional enterprise level android apps.
2. Understand the architecture of ...
Agenda
3
SL
NO
AGENDA TOPICS
1 Android Introduction
2 Android & It’s Features
3 Android Releases
4 Android Architecture
5 ...
Android Introduction
4
• A Software platform and Linux Kernel based Operating System for mobile.
• Android is Open Source ...
Android & It’s Features
5
• Application framework enabling reuse and replacement of components.
• Integrated browser based...
Android & It’s Features (Cont.)
6
formats (MPEG4, Media support for common audio, video, and still image
H.264, MP3, AAC,...
Android Releases - Android
7
1. Cupcake (1.5)
2. Donut (1.6)
3. Eclair (2.0–2.1)
4. Froyo (2.2–2.2.3)
5. Gingerbread (2.3–...
Android Releases – Android (Cont.)
Nougat
8
Try For It…..
WHAT DO YOU THINK
• What is the similarity among different versions
of Android releases?
• Which is the late...
Android Architecture
10
Android Architecture – Linux Kernel
Linux Kernel
• This layer is core of Android architecture.
• It provides services like...
Android Architecture – Native Libraries
Native Libraries
•Android software stack libraries.
•Android has its own libraries...
Android Architecture – Application Framework
all applications uses and is written in a Java programming
Application Framew...
Dalvik Virtual Machine
• Providing environment on which every Android application runs
• Each Android application runs in ...
Android Architecture - Android Runtime
15
ART (Android RunTime)
• It is the next version of Dalvik introduced in KitKat ve...
Android Architecture - Android Runtime (Cont.)
16
Android Play Store
Just 25$ for
Registration.
https://play.google.com
/apps/publish/signup/
upload free / paid
apps.
17
Android Devices
18
Justify It…
WHAT DO YOU THINK
•Can we release any app as paid if we have once released
it as free?
• What is the cost of G...
Set Up Your Environment
20
1. Download Android Studio.
2. A software development kit that enables developers to create app...
Build Your First AndroidApp
21
Create an Android Project
• In Android Studio, create a new project:
If you don't have a p...
Build Your First Android App(Cont.)
22
Company domain provides a qualifier that will be appended to the package
name; And...
Step - 1
23
Build Your First Android App (Cont.)
24
• Under Select the form factors your app will run on, check the box for Phone
and ...
Step -2
25
Build Your First Android App (Cont.) Step 3
• Under Add an activity to <template>, select Blank Activity and click Next.
26
Build Your First Android App (Cont.)
27
• Under Customize the Activity, change the Activity Name to MyActivity.
The Layout...
Step-4
28
Finally Project Created
Your Android project is now a basic "Hello World" app that contains some default files.
Click here...
Android Application Project Structure
• 1.idea
The project specific metadata is stored by Android Studio.
• 2. Project Mod...
• 3. gradle
• This is where the gradle build system’s jar wrapper i.e. this jar is how
Android System communicates with gr...
Android Manifest
32
Android manifest acts as a metadata for Android Application.
Here we declare all the attributes of act...
Gradle Build
• The build process involves many tools and processes that convert your project
into an Android Application P...
Gradle Files
34
Gradle build can be categorized into two parts:
• Top-Level Build File
The top-level build.gradle file, lo...
AVD
35
• An Android Virtual Device (AVD) definition lets you define the characteristics of
an Android phone, tablet, Andro...
AVD (Cont.)
36
• Download Bluestack .
• Download Genymotion.
• Run on Real Device.
 For that Go to Setings >> Developer O...
Run Your App
37
• Run the app from Android Studio.
• Select one of your project's files and click Run from the toolbar.
• ...
Justify It…
WHAT DO YOU THINK
• Where to edit app name & launcher icon?
• How android device knows which page to launch fi...
Supporting Different Languages
39
• Android supports many different languages.
• It’s always a good practice to extract UI...
Supporting Different Languages (Cont.)
40
• Add the string values for each locale into the appropriate file.
• At runtime,...
Supporting Different Languages (Cont.)
41
Spanish,
/values-es/strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resourc...
Supporting Different Platform Versions
42
Sometimes the latest APIs, functions, things are not supported by older versions...
Supporting Different Platform Versions (Cont.)
43
Check System Version at Runtime
• Android provides a unique code for eac...
Supporting Different Screens
44
• Android categorizes device screens using two general properties: size and density.
Appli...
Supporting Different Screens (Cont.)
45
• For example, a unique layout for large screens should be saved under res/layout-...
Supporting Different Screens (Cont.)
46
MyProject/
res/
drawable-xhdpi/
awesomeimage.png
drawable-hdpi/
awesomeimage.png
d...
Supporting Different Screens (Cont.)
47
• In manifest file you need to make some changes for supporting different tags:
<s...
LETS DISCUSS
ASSIGNMENTS
LEARN. DO. EARN
THANK YOU
Email us at - support@acadgild.com
LEARN. DO. EARN
Próximos SlideShares
Carregando em…5
×

Android Introduction and its Fundamentals | Android Study Material For Beginners | Android Pdf

515 visualizações

Publicada em

Android Introduction and its Fundamentals | Android Study Material For Beginners | Android Pdf
This as an android beginner tutorial, check out the objective of the tutorial.
1. Learn how to develop professional enterprise level android apps.
2. Understand the architecture of android applications, life Cycle of various components, manifest, Intents and the use of external resources for Android development.
3. Learn how to design and develop android applications user interfaces using material design
4. Learn how to use android application framework API to build complex Android apps.
5. Learn how to utilize the supremacy of background services, threads, asynchronous tasks and notifications.
6. Learn how to secure, tune, package and deploy android apps.

For more updates on courses and tips follow us on:
Facebook: https://www.facebook.com/acadgild
Twitter: https://twitter.com/acadgild
LinkedIn: https://www.linkedin.com/company/acadgild

Publicada em: Tecnologia
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1url.pw/2rzGr ◀ ◀ ◀ ◀
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui

Android Introduction and its Fundamentals | Android Study Material For Beginners | Android Pdf

  1. 1. Session-1 Android Introduction And Its Fundamentals LEARN. DO. EARN
  2. 2. Course Objectives 2 1. Learn how to develop professional enterprise level android apps. 2. Understand the architecture of android applications, life Cycle of various components, manifest, Intents and the use of external resources for Android development. 3. Learn how to design and develop android applications user interfaces using material design 4. Learn how to use android application framework API to build complex Android apps. 5. Learn how to utilize the supremacy of background services, threads, asynchronous tasks and notifications. 6. Learn how to secure, tune, package and deploy android apps.
  3. 3. Agenda 3 SL NO AGENDA TOPICS 1 Android Introduction 2 Android & It’s Features 3 Android Releases 4 Android Architecture 5 Android Architecture – Linux Kernel 6 Android Architecture – Native Libraries 7 Android Architecture – Application Framework SL NO AGENDA TOPICS 8 Android Architecture – Android Runtime 9 Android Play Store 10 Android Devices 11 Set Up Environment 12 Create a New Project 13 Android Application Project Structure 14 Android Manifest SL NO AGENDA TOPICS 15 Gradle 16 Android Virtual Devices (AVD) 17 Supporting Different Languages 18 Supporting Different Platform Versions 19 Supporting Different Screens
  4. 4. Android Introduction 4 • A Software platform and Linux Kernel based Operating System for mobile. • Android is Open Source which means it is made freely available and may be redistributed and modified. • Android was founded way back in 2003. • Android was developed by the Andy Rubin, Rich Miner, Nick Sears and Chris White as a part of Android Inc Start Up. • Android was purchased by the GOOGLE in AUGUST, 2005 for 50 million $. • OHA (Open Handset Alliance) is a group of companies, which allowed the use of open source code of Android and develop applications.
  5. 5. Android & It’s Features 5 • Application framework enabling reuse and replacement of components. • Integrated browser based on the open source WebKit engine. • Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional). • SQLite for structured data storage.
  6. 6. Android & It’s Features (Cont.) 6 formats (MPEG4, Media support for common audio, video, and still image H.264, MP3, AAC, AMR, JPG, PNG, GIF) and Voice Search.  GSM Telephony (hardware dependent)  NFC, Bluetooth, EDGE, 3G, and WiFi (hardware dependent)  Camera, GPS, compass, and accelerometer (hardware dependent)
  7. 7. Android Releases - Android 7 1. Cupcake (1.5) 2. Donut (1.6) 3. Eclair (2.0–2.1) 4. Froyo (2.2–2.2.3) 5. Gingerbread (2.3–2.3.7) 6. Honeycomb (3.0–3.2.6) 7. Ice Cream Sandwich (4.0– 4.0.4) 8. Jelly Bean (4.1–4.3.1) 9. KitKat (4.4–4.4.4, 4.4W– 4.4W.2) 10. Lollipop (5.0–5.1.1) 11. Marshmallow (6.0–6.0.1) 12. Nougat (7.0 – 7.1.1)
  8. 8. Android Releases – Android (Cont.) Nougat 8
  9. 9. Try For It….. WHAT DO YOU THINK • What is the similarity among different versions of Android releases? • Which is the latest version available in market ? • Which is the lowest version of which devices are available in market ? 9
  10. 10. Android Architecture 10
  11. 11. Android Architecture – Linux Kernel Linux Kernel • This layer is core of Android architecture. • It provides services like power management, memory management, security etc. • Binder for process communication. • This layer provides an abstraction layer between the hardware and rest of the software stack. 11
  12. 12. Android Architecture – Native Libraries Native Libraries •Android software stack libraries. •Android has its own libraries, which is written in C/C++ like web libraries to access web browser, libraries for android video formats. • Application framework access these libraries. 12
  13. 13. Android Architecture – Application Framework all applications uses and is written in a Java programming Application Framework • This is the toolkit that language. • Enabling and simplifying the reuse of Components. • Developers have full access to the same framework APIs used by the core applications. 13
  14. 14. Dalvik Virtual Machine • Providing environment on which every Android application runs • Each Android application runs in its own process, with its own instance of the Dalvik VM. • Dalvik has been written such that a device can run multiple VMs efficiently. • Register-based virtual machine. • Executing the Dalvik Executable (.dex) format • .dex format is optimized for minimal memory footprint. • Compilation. • Relying on the Linux Kernel for: • Threading. • Low-level memory management. 14
  15. 15. Android Architecture - Android Runtime 15 ART (Android RunTime) • It is the next version of Dalvik introduced in KitKat version. • Dalvik is the runtime, bytecode, and VM used by the Android system for running Android applications. • ART has two main features compared to Dalvik: 1.Ahead-of-Time (AOT) compilation, which improves speed (particularly startup time) and reduces memory footprint (no JIT). 2. Improved Garbage Collection.
  16. 16. Android Architecture - Android Runtime (Cont.) 16
  17. 17. Android Play Store Just 25$ for Registration. https://play.google.com /apps/publish/signup/ upload free / paid apps. 17
  18. 18. Android Devices 18
  19. 19. Justify It… WHAT DO YOU THINK •Can we release any app as paid if we have once released it as free? • What is the cost of Google App publish account? • How many apps can be released under one account? 19
  20. 20. Set Up Your Environment 20 1. Download Android Studio. 2. A software development kit that enables developers to create applications for the Android platform. The Android SDK includes sample projects with source code, development tools, an emulator, and required libraries to build Android applications. Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use which runs on top of a Linux kernel. 3. Download the latest SDK tools and platforms using the SDK Manager . 4. Click here for Detailed Step by Step Guide Installation Guide . 5. Click here to watch video .
  21. 21. Build Your First AndroidApp 21 Create an Android Project • In Android Studio, create a new project: If you don't have a project opened, in the Welcome screen, click New Project. If you have a project opened, from the File menu, select New Project. The Create New Project screen appears. • Fill out the fields on the screen, and click Next. Application Name is the app name that appears to users. For this project, use "My First App."
  22. 22. Build Your First Android App(Cont.) 22 Company domain provides a qualifier that will be appended to the package name; Android Studio will remember this qualifier for each new project you create. Package name is the fully qualified name for the project. Your package name must be unique across all packages installed on the Android system. You can Edit this value independently from the application name or the company domain. This defines the uniqueness of the application. • Project location is the directory on your system that holds the project files.
  23. 23. Step - 1 23
  24. 24. Build Your First Android App (Cont.) 24 • Under Select the form factors your app will run on, check the box for Phone and Tablet. • For Minimum SDK, select API 15: Android 4.0.3 (IceCreamSandwich). • Leave all of the other options (TV, Wear, and Glass) unchecked and click Next.
  25. 25. Step -2 25
  26. 26. Build Your First Android App (Cont.) Step 3 • Under Add an activity to <template>, select Blank Activity and click Next. 26
  27. 27. Build Your First Android App (Cont.) 27 • Under Customize the Activity, change the Activity Name to MyActivity. The Layout Name changes to activity_my, and the Title to MyActivity. The Menu Resource Name is menu_my. • Click the Finish button to create the project.
  28. 28. Step-4 28
  29. 29. Finally Project Created Your Android project is now a basic "Hello World" app that contains some default files. Click here to know more about building first app. 29
  30. 30. Android Application Project Structure • 1.idea The project specific metadata is stored by Android Studio. • 2. Project Module (app) This is the actual project folder where your application code resides. The application folder has following sub directories • a. build: This has all the complete output of the make process i.e. classes.dex, compiled classes and resources, etc. • b. libs : This is a commonly seen folder in eclipse land too, which optionally can hold the libraries or .jar files. • c. src: The src folder can have both application code (main) & android unit test script(“androidTest” ). • The java folder contains all the java codes and res contains drawables, layouts, etc. 30
  31. 31. • 3. gradle • This is where the gradle build system’s jar wrapper i.e. this jar is how Android System communicates with gradle installed in OS • 4. External Libraries • A place where Referenced Libraries are found and also target SDK Platform. 31
  32. 32. Android Manifest 32 Android manifest acts as a metadata for Android Application. Here we declare all the attributes of activity tags, permissions, services, broadcast receivers etc. Syntax: <manifest> <Elements for Application properties should come here> <application> <Elements for application components should come here> </application> </manifest> Click here to know more about App Manifest
  33. 33. Gradle Build • The build process involves many tools and processes that convert your project into an Android Application Package (APK). 33
  34. 34. Gradle Files 34 Gradle build can be categorized into two parts: • Top-Level Build File The top-level build.gradle file, located in the root project directory, defines build configurations that apply to all modules in your project. • Module-level Build File The module-level build.gradle file, located in each <project>/<module>/ directory, allows you to configure build settings for the specific module it is located in. Configuring these build settings allows you to provide custom packaging options, such as additional build types and product flavors, and override settings in the main/ app manifest or to level build.gradle file.
  35. 35. AVD 35 • An Android Virtual Device (AVD) definition lets you define the characteristics of an Android phone, tablet, Android Wear, or Android TV device that you want to simulate in the Android Emulator. The AVD Manager helps you easily create and manage AVDs. • An AVD is virtual environment where you can run your application and can debug and test it. • Other various AVD where you can test and debug your application are Bluestack, Genymotion, Real device etc.
  36. 36. AVD (Cont.) 36 • Download Bluestack . • Download Genymotion. • Run on Real Device.  For that Go to Setings >> Developer Options. Enable USB debugging.  If you are not able to find Developer options in you phone; go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.  Plug in your device to your development machine with a USB cable.  Click here to know more about how to run on real device
  37. 37. Run Your App 37 • Run the app from Android Studio. • Select one of your project's files and click Run from the toolbar. • In the Choose Device window that appears, select the Choose a running device radio button, select your device, and click OK . • Android Studio installs the app on your connected device and starts it. You can execute the application on Real device, Android AVD, third party Emulators Genymotion, Bluestack.
  38. 38. Justify It… WHAT DO YOU THINK • Where to edit app name & launcher icon? • How android device knows which page to launch first? • Where to find dependency libraries added so that I can edit? • Where to edit minimum, target, compile API levels? • Does the version of target, compile & android provided libraries should be of same API level or can be different? 38
  39. 39. Supporting Different Languages 39 • Android supports many different languages. • It’s always a good practice to extract UI strings from your app code and keep them in an external file. Android makes this easy with a resources directory in each Android project. • To support different languages first you need to decide the languages you will support in app. • Create the resource subdirectories and string resource files. For example: MyProject / res/ values/ strings.xml values-es/ strings.xml values-fr/ strings.xml • Here –es , -fr are locale of languages.
  40. 40. Supporting Different Languages (Cont.) 40 • Add the string values for each locale into the appropriate file. • At runtime, the Android system uses the appropriate set of string resources based on the locale currently set for the user's device. English (default locale), /values/strings.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="title">My Application</string> <string name="hello_world">Hello World!</string> </resources>
  41. 41. Supporting Different Languages (Cont.) 41 Spanish, /values-es/strings.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="title">Mi Aplicación</string> <string name="hello_world">Hola Mundo!</string> </resources> Now when you will set these values to Textview, at run time the locale of device will access these values and the same language will be displayed.
  42. 42. Supporting Different Platform Versions 42 Sometimes the latest APIs, functions, things are not supported by older versions. While developing for latest feature we should not stop support for lower versions. • The AndroidManifest.xml file describes in details about your app and identifies which versions of Android it supports. • Specifically, min Sdk Version and target Sdk Version attributes for the <uses-sdk> element identify the lowest API level with which your app is compatible and the highest API level against which you have designed and tested your app. For example: <manifest xmlns:android="http://schemas.android.com/apk/res/android" ... > <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" /> ... </manifest>
  43. 43. Supporting Different Platform Versions (Cont.) 43 Check System Version at Runtime • Android provides a unique code for each platform version in the Build constants class. Use these codes within your app to build conditions that ensure the code that depends on higher API levels is executed only when those APIs are available on the system. • Build.VERSION.SDK_INT “provides the version code of the device Android OS version. For Example : if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { // do code here for versions greater than equal to Honeycomb }else{ // do code here for versions less than Honeycomb }
  44. 44. Supporting Different Screens 44 • Android categorizes device screens using two general properties: size and density. Applications installed on devices with screens that range in both size and density. • There are four generalized sizes: small, normal, large, xlarge. • And four generalized densities: low (ldpi), medium (mdpi), high (hdpi), extra high (xhdpi). • To optimize looks of app on different screen sizes, you should create a unique layout XML file for each screen size you want to support. Each layout should be saved into the appropriate resources directory, named with a -<screen_size> suffix.
  45. 45. Supporting Different Screens (Cont.) 45 • For example, a unique layout for large screens should be saved under res/layout- large/. MyProject/ res/ layout/ main.xml layout-land/ main.xml By default, the layout/main.xml file is used for portrait orientation.
  46. 46. Supporting Different Screens (Cont.) 46 MyProject/ res/ drawable-xhdpi/ awesomeimage.png drawable-hdpi/ awesomeimage.png drawable-mdpi/ awesomeimage.png drawable-ldpi/ awesomeimage.png • Any time you refer @drawable/awesomeimage, the system selects the appropriate bitmap based on the screen's density.
  47. 47. Supporting Different Screens (Cont.) 47 • In manifest file you need to make some changes for supporting different tags: <supports-screens android:resizeable=["true"| "false"] android:smallScreens=["true" | "false"] android:normalScreens=["true" | "false"] android:largeScreens=["true" | "false"] android:xlargeScreens=["true" | "false"] android:anyDensity=["true" | "false"] android:requiresSmallestWidthDp="integer" android:compatibleWidthLimitDp="integer" android:largestWidthLimitDp="integer"/> This tag will set the support and compatibility with all devices.
  48. 48. LETS DISCUSS ASSIGNMENTS LEARN. DO. EARN
  49. 49. THANK YOU Email us at - support@acadgild.com LEARN. DO. EARN

×