Lecture 2_Android basics PDF

Summary

This document is a lecture about Android basics. It discusses the Android operating system, its features, the different types of android devices, and some preinstalled applications. It also looks at the Android Architecture layers.

Full Transcript

Unit II: Mobile Programming 1 Introduction to android  What is a android?  A software platform and operating system for mobile devices such as smartphones and tablets.  Based on the Linux kernel  Developed by Google and later the Open Handset Alliance (OHA)...

Unit II: Mobile Programming 1 Introduction to android  What is a android?  A software platform and operating system for mobile devices such as smartphones and tablets.  Based on the Linux kernel  Developed by Google and later the Open Handset Alliance (OHA)  Allows writing managed code in the Java language  Unveiling of the Android platform was announced on 5 November 2007 with the founding of OHA Introduction to android  Open Source Operating System:  Android is an open-source operating system, which means that its source code is freely available for modification and distribution by developers. This openness has contributed to the widespread adoption of Android on various devices.  Linux Kernel:  Android is built on top of the Linux kernel, providing a robust and secure foundation for the operating system.  Application Development:  Android applications are primarily developed using Java, but developers can also use other programming languages, including Kotlin. The Android SDK (Software Development Kit) provides the tools and libraries necessary for creating Android applications.. Introduction to android  Google Play Store:  The Google Play Store is the official marketplace for Android applications. Users can download and install applications, games, and other content from the Play Store.  User Interface:  Android features a customizable user interface, allowing device manufacturers and users to modify the look and feel of the operating system. The user interface is built using XML (eXtensible Markup Language) for layout design.  Versions and Releases:  Android releases are named after desserts or sweet treats, following an alphabetical order (e.g., Cupcake, Donut, KitKat, Oreo, etc.). Each new version introduces improvements, features, and optimizations. Introduction to android Why android? Features of android  The base Android OS supports many features, including:  Storage - SQLite, a lightweight relational database, for data storage.  Connectivity - GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth (includes A2DP and AVRCP), Wi-Fi, LTE, and WiMAX.  Messaging - Both SMS and MMS.  Media support - H.263, H.264 (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC, HE-AAC (in MP4 or 3GP container), MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP. Features of android  Hardware support - Accelerometer sensor, camera, digital compass, proximity sensor, and GPS.  Multi-touch - Multi-touch screens.  Multi-tasking - Multi-tasking applications.  Tethering -Sharing of Internet connections as a wired/wireless hotspot.  Web browser - Based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine supporting HTML5 and CSS3. Android devices in the market  Android devices come in all shapes and sizes including, but not limited to the following types  Smartphones  Tablets  E-reader devices  Internet TVs  Automobiles  Smartwatches Pre-installed android applications  Android devices typically come with a suite of preinstalled applications that users expect. On smartphones these typically include  A phone dialer  A music player and picture gallery  An SMS management application  A camera and video recording  A web browser application  An e-mail client  A calculator  A calendar  A home screen  A contacts list  An alarm clock Android devices in the market  In many cases Android devices also ship with the following proprietary Google mobile applications:  The Google Play Store for downloading third-party Android applications  The Google Maps application, including StreetView, driving directions, and turn-by-turn  navigation, satellite views, and traffic conditions  The Gmail email client  The YouTube video player  The Google Chrome browser  The Google home screen and Google Assistant Android Architecture/Platform Figure 1 Android Architecture comprises five levels, which are the Linux kernel, Libraries, Application framework, Android runtime, and System applications. Figure 1: Android Architecture/Platform Figure 2 Android Architecture/Platform 1: Linux Kernel  Linux kernel is the bottom-most important layer of the Android architecture, and it is the core part of Android architecture.  It provides features such as:  Security  Process management  Memory management  Device management  Multitasking  It is also responsible for a level of abstraction between device hardware and upper layers of Android architecture.  It consists of device drivers like a camera, flash memory, Display, keypad, Wifi, etc. Android Architecture/Platform 2: Libraries  This layer consists of a set of Libraries and Android Runtime.  The Android component is built using native codes and requires native libraries, which are written in C/C++, and most of the libraries are open-source libraries.  It also handles data that is specific to the hardware.  Some of the native libraries are SSL, SQLite, Libc, OpenGL, media framework, FreeType and Surface Manager. Android Architecture/Platform 3: Android Runtime  The Android runtime is located in the same layer as the libraries and provides a set of core libraries that enable developers to write Android apps using the Java programming language.  The Android runtime also includes the DVM (Dalvik Virtual Machine)  It enables every Android application to run in its own process, with its own instance of the Dalvik virtual machine.  A process is an instance of a program which is being executed.  Android applications are compiled into Dalvik executables.  Dalvik is a specialised virtual machine designed specifically for Android and optimised for battery-powered mobile devices with limited memory and CPU power. Android Architecture/Platform 4: Application Framework  The application framework built on top of the native library layer provides an Application programming interface and higher-level services.  Also, the features of the Android operating system are available to us through API’s written in the form of JAVA classes. Android developers use these high-level services to build applications.  The application framework consists of the following key services:  Activity Manager: The method in this class uses testing and debugging methods.  Content provider: It provides data from the application to other layers.  Resource Manager: It provides access to non-code resources.  Notification Manager: The users get notifications about all the actions happening in the background.  View System: It acts as a base class for widgets and is responsible for event handling. Android Architecture/Platform 5: Applications  It is the top-most layer of Android architecture.  This layer consists of native Android applications and third-party installed apps.  They are bundled in an Android package and all the applications that are to be installed are written in this layer only, such as contacts, games, settings, and messages. Required tools  Before you write your first app, you need to download the required tools  For Android development, you can use a Mac, a Windows PC, or a Linux machine  The Android Studio makes use of the Java SE Development Kit (JDK). If your computer does not have the JDK installed, you should download it from oracle website www.oracle.com  Make sure you have oracle account before download JDK Android Studio  The first and most important piece of software you need to download is Android Studio. For this course, I recommend downloading Android Studio Dolphin | 2021.3.1 September 15, 2022, from Android Studio download archives  It is the official IDE (Integrated Development Environment) for Android development, created by Google. You can use it to build Android apps on Windows, Linux, and Mac OS operating systems.  Android Studio provides the fastest tools for building apps on every Android device  Android Studio supports all programming languages you can use for Android development: Java, C/C++, and Kotlin.. Android Studio  This IDE is based on IntelliJ IDEA (a popular Java IDE), which offers a powerful code editor and developer tools  It comes bundled with Android SDK (Software Development Kit) and some additional development tools such as AVD Manager and Android Debug Bridge.  Android Studio includes a visual layout editor, an APK (Android Package) analyzer, an Android device emulator, and real-time performance profiling tools. Android Software Development Kit (SDK)  Android Software Development Kit (SDK) is a set of tools and resources provided by Google for developers to create applications for the Android platform.  The SDK includes everything developers need to build, test, and debug Android applications.  The Android SDK is free to download and use, and it is available for Windows, macOS, and Linux.  The Android SDK is composed of modular packages that you can download separately using the Android SDK Manager. The toolkit includes: SDK tool, SDK platform tools, SDK documentation, Android SDK resources, Google API, Android support. AVD Manager  AVD Manager is a built-in tool of Android Studio.  AVD stands for Android Virtual Device.  It makes it possible to create virtual Android devices for testing purposes.  An AVD is a configuration that describes the characteristics of a virtual device, such as hardware profile, storage area, appearance, system image, and other attributes.  AVD enables you to create as many AVDs as you want.  You can access your virtual devices for testing purposes in the Android Emulator that also comes bundled with Android Installing "Android Studio IDE" and "Android SDK"  Windows requirements  64-bit Microsoft® Windows® 8/10/11  x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD CPU with support for a Windows Hypervisor  8 GB RAM or more  8 GB of available disk space minimum (IDE + Android SDK + Android Emulator)  1280 x 800 minimum screen resolution Installing "Android Studio IDE" and "Android SDK"  Check system requirements (Windows 10) 1) Open Settings. 2) Click System. 3) At the bottom of the left-hand navigation pane, click About. 4) Make sure that the Windows specifications meet or exceed the requirements. 5) Select Device specifications. Make sure that the Installed RAM is at least as much as is required and that the system type is the 64-bit version of the operating system. 6) In the navigation pane, click Display. Make sure that the Resolution is the same or better than what's required. Installing "Android Studio IDE" and "Android SDK"  Verify storage 1) Open the file explorer. 2) In the left-hand navigation pane, click This PC. 3) Ensure that the local storage has enough free space to install Android Studio. Installing "Android Studio IDE" and "Android SDK"  Step 1. Install Oracle Java Development Kit ("JDK")  Android apps are written in Java.  You need the Oracle Java compiler and libraries on your system.  These are collectively called the Java Development Kit or "JDK" for short  Required JDK 1.8 or higher  Download JDK installer (x86 or x64) from oracle website and follow all the required steps to install on your windows machine.  Finally, make sure that environment variable JAVA_HOME is set to the JDK installation directory Installing "Android Studio IDE" and "Android SDK"  Step 2. Install Android Studio IDE  Download Android Studio Dolphin from Android Studio download archives  Run the downloaded installer ⇒ You may watch a short video @ on LMS to install it  In "Choose Components", select "Android Studio" and "Android Virtual Device".  In "Configuration Settings Install Location", accept the default "C:\ Program Files\Android\Android Studio".  In "Choose Start Menu Folder", accept the default ⇒ Install.  Launch Android Studio. Continue to the next Step. END OF LECTURE

Use Quizgecko on...
Browser
Browser