The document provides an overview of Android, a mobile operating system based on the Linux kernel, which powers over 80% of smartphones and supports a vast number of applications. It discusses the Android development environment, including the Android Software Development Kit (SDK) and Android Studio as the official IDE, as well as the architecture and components of Android applications. Additionally, it outlines the challenges of Android development and provides a project proposal template for students to create their own Android apps.
The document provides an overview of Android, a mobile operating system based on the Linux kernel, which powers over 80% of smartphones and supports a vast number of applications. It discusses the Android development environment, including the Android Software Development Kit (SDK) and Android Studio as the official IDE, as well as the architecture and components of Android applications. Additionally, it outlines the challenges of Android development and provides a project proposal template for students to create their own Android apps.
The document provides an overview of Android, a mobile operating system based on the Linux kernel, which powers over 80% of smartphones and supports a vast number of applications. It discusses the Android development environment, including the Android Software Development Kit (SDK) and Android Studio as the official IDE, as well as the architecture and components of Android applications. Additionally, it outlines the challenges of Android development and provides a project proposal template for students to create their own Android apps.
The document provides an overview of Android, a mobile operating system based on the Linux kernel, which powers over 80% of smartphones and supports a vast number of applications. It discusses the Android development environment, including the Android Software Development Kit (SDK) and Android Studio as the official IDE, as well as the architecture and components of Android applications. Additionally, it outlines the challenges of Android development and provides a project proposal template for students to create their own Android apps.
Download as PPTX, PDF, TXT or read online from Scribd
Download as pptx, pdf, or txt
You are on page 1/ 40
INTRODUCTION
ROMI FADILLAH RAHMAT, B.COMP.SC., M.SC
MOBILE PROGRAMMING WHAT IS ANDROID?
• Mobile operating system based on Linux Kernel
• User Interface for touch screens • Used on over 80% of all smartphones • Power devices such as watches, TVs, and cars • Over 2 Million Android Apps in Google Play Store • Highly customizable for devices/by vendors • Open source ANDROID USER INTERACTION
• Touch gestures : Swiping, Tapping, Pinching
• Virtual keyboard for characters, numbers, and emoji • Support for Bluetooth, USB Controllers, WiFi adapters, and peripherals ANDROID AND SENSORS
Sensors (such as proximity sensors, accelerometer sensors,
etc) can discover user interaction and respond • Device contents rotate as needed • Walking adjusts position on map • Tilting steers a virtual car or controls a physical toy • Moving too fast disables game interactions. ANDROID HOME SCREEN
• Home screen in android itself is an application which can
contain applications. • Launcher icons for apps • Self-updating widgets for live content • Can be multiple pages • Folders to organize apps • “OK Google” ANDROID SOFTWARE DEVELOPER KIT (SDK)
• Android apps had been developed using Eclipse integrated
development environment (IDE) with Android Development Tools (ADT) plugin in the past. • Google introduced Android Studio as the official IDE for Android app development in 2014 and this IDE became the standard. • Now -> Android Studio Chipmunk - 2021.2.1 ANDROID STUDIO • Official Android IDE • Develop, run, debug, test, and package apps • Monitors, and performance tools • Virtual devices • Project views • Visual Layout Editor GOOGLE PLAY STORE
Publish apps through Google Play store:
• Official app store for Android • Digital distribution service operated by Google ANDROID HISTORY
• Android is an open-source mobile operating system.
• Architecture of the OS variant of Linux hence providing extensive security, modularity and productivity at the mobile device level • Android is developed and maintained by the organization called “Open Headset Alliance” (OHA). • OHA was established in 2007 with Google being its foremost member. ANDROID TIMELINE ANDROID TIMELINE • The Android SDK was first issued as an “early look” release in November 2007. • In September 2008, T-Mobile announced the availability of T-Mobile G1, the first smartphone based on the Android platform • In October 2008, Google made the source code of the Android platform available under Apache’s open source license • When Android was released, one of its key architectural goals was to allow applications to interact with one another and reuse components from one another. Applies to services, data and the user interface (UI). • As a result, the Android platform has a number of architectural features that keep this openness a reality. ANDROID TIMELINE • In late 2008 Google released a handheld device called Android Dev Phone 1 that was capable of running Android applications without being tied to any cell phone provider network. • In April 2009 release 1.5 SDK, along with a number of other features, such as advanced media-recording capabilities, widgets, and live folders. • In September 2009 came release 1.6 of the Android OS and, within a month, Android 2.0 followed, facilitating a flood of Android devices ANDROID HISTORY
• Originally, Android was created by a company called Android
Inc. Google acquired this company in 2005. • After then, Google made it open-source and Android gained a big momentum. • Android has the market share of around 85% in 2016 • Considering this market share, it is obviously rewarding to invest in Android app development ANDROID MARKET SHARE ANDROID VERSION • Android has eight major releases each having several minor revisions. In order to follow these versions easier, developers name them with cookie names. • The popular versions of Android are Kitkat (Android 4.4), Lollipop (Android 5.1) and Marshmallow (Android 6.0) , Nougat (Android 7.0), and Oreo (Android 8.0). • Android becomes more capable as the version goes up. However, we have to be careful about selecting the version during app development because not every device uses the latest version. If we develop an app for the Lollipop, it may not run on a device which has Froyo installed. • Android is utilized not only in smartphones but also in tablets, netbooks, digital television boxes, handheld game devices and even in single board computers. HOW ANDROID APPS WORK? • There are different ways the programs run on various platforms. The lowest level software can be written in machine code that runs directly on the microprocessor. • Since it is difficult to develop complex applications in machine code, operating systems are used. Operating systems provide a communication and control layer between the application software and the hardware COMPILER AND LINKER • If we want to develop a native application for running on a specific hardware/operating system, we have to do this using a compiler and linker. Compiler and linker takes the source code and creates the executable file that actually runs on the operating system • The main advantage of native applications is their speed. However, the disadvantage is the incompatibility across different platforms. For example, we cannot run a native Windows application on Ubuntu and vice versa. • Virtual machine concept is developed to overcome this limitation. Virtual machine is software that runs on the operating system and provides an abstraction to the developer. The application software runs on top of the virtual machine JAVA VIRTUAL MACHINE • Therefore, as long as a computer has the virtual machine running, the application software can run on that computer independent of the hardware and the operating system. A good example is the Java Virtual Machine (JVM). JVM runs on almost all operating systems and platforms. Therefore, when we develop Java software, it will be run on the JVM independent of the operating system/platform. • The obvious advantage of developing apps that run on virtual machines can then be stated as: “develop once and run on all platforms”. However, applications running on virtual machines are slower than native applications. PROGRAMMING LANGUAGE USED IN AND. DEV • The recommended and convenient way of developing Android apps is using Java programming language. It is used in conjunction with Android Software Development Kit (SDK) in Android Studio environment to develop apps. • Another official way is using C++ with the Native Development Kit (NDK). This option is used for developing apps with low level instructions such as timing sensitive drivers. With C++ and NDK, we can directly run the app on the Android kernel hence increasing efficiency in exchange of code length and development cost. • There also exist third-party tools like Xamarin, Crodova and React Native for developing apps. These platforms provide convenience however a native- like performance isn’t normally expected from the apps developed by third party tools HIGH LEVEL VIEW OF ANDROID APPLICATION ANDROID SOFTWARE STACK 1. System and user apps 2. Android OS API in Java framework 3. Expose native APIs; run apps 4. Expose device hardware capabilities 5. Linux Kernel 1. SYSTEM AND USER APPS
• System apps are inbuilt application (exp: Call application, sms
application, google chrome application, etc) • User apps which you install separately such as Whatsapp, Facebook, and so on • System apps provide key capabilities to app developers
Example : Your app can use a system app to deliver a SMS message. 2. JAVA API FRAMEWORK
• The entire feature-set of the Android OS is available to you
through APIs written in the Java language. • View class hierarchy to create UI screens • Notification manager • Activity manger for life cycles and navigation • Content providers to access data from other apps 3. ANDROID VIRTUAL MACHINE • Similar to Java applications, Android applications also run on a JVM. • There are two special virtual machines used in Android: Dalvik Virtual Machine (DVM) and Android RunTime (ART). • These are specialized JVMs which can run on low system resources. • The .apk files (executables of Android apps) actually run on these virtual machines. • DVM has been the default runtime environment (~ virtual machine) until the Lollipop release (Android 5.0). 3. ANDROID VIRTUAL MACHINE • ART is introduced by Android 4.0 and has been the default VM as of Android 5.0. • DVM and ART basically do the same job: running Android apps independent of the platform. • The main advantage of ART over DVM is the utilization of a concept called Ahead of Time (AOT) compilation instead of Just in Time (JIT) approach. • In AOT, apps are compiled during installation hence they load faster with lower CPU usage. On the other hand, JIT compilation provides lower storage space consumption with ANDROID SOFTWARE STACK • At the core of the Android Platform is Linux kernel responsible for device drivers, resource access, power management, and other OS duties. The supplied device drivers include Display, Camera, Keypad, WiFi, Flash Memory, Audio, and IPC (interprocess communication). • Sitting at the next level, on top of the kernel, are a number of C/C++ libraries such as OpenGL, WebKit, FreeType, Secure Sockets Layer (SSL), the C runtime library (libc), SQLite, and Media • The system C library based on Berkeley Software Distribution (BSD) is tuned (to roughly half its original size) for embedded Linux-based devices. • The media libraries are based on PacketVideo’s OpenCORE. These libraries are responsible for recording and playback of audio and video formats. • A library called Surface Manager controls access to the display system and supports 2D and 3D ANDROID SOFTWARE STACK • The WebKit library is responsible for browser support; it is the same library that supports Google Chrome and Apple’s Safari. • The FreeType library is responsible for font support • SQLite is a relational database that is available on the device itself. • Most of the application framework accesses these core libraries through the Dalvik VM, the gateway to the Android Platform • Dalvik is optimized to run multiple instances of VMs. • As Java applications access these core libraries, each application gets its own VM instance ANDROID SOFTWARE STACK • The Android Java API’s main libraries include telephony, resources, locations, UI, content providers (data), and package managers (installation, security, and so on). • Programmers develop end-user applications on top of this Java API. Some examples of end-user applications on the device include Home, Contacts, Phone, Browser, and so on. • Android also supports a custom Google 2D graphics library called Skia, which is written in C and C++. ANDROID SOFTWARE STACK • The 3D APIs in Android, are based on an implementation of OpenGL ES from the Khronos group • From a media perspective, the Android Platform supports the most common formats for audio, video, and images. From a wireless perspective, Android has APIs to support Bluetooth, EDGE, 3G, WiFi, and Global System for Mobile Communication (GSM) telephony, depending on the hardware WHAT IS AN ANDROID APP?
• One or more interactive screens
• Written in Java Programming Language and XML • Uses the Android Software Development Kit (SDK) • Uses Android Libraries and Android Application Framework • Executed by Android Runtime Virtual Machine (ART) CHALLENGES OF ANDROID DEVELOPMENT
• Multiple screen sizes and resolutions
• Performance : make your apps responsive and smooth • Security : Keep source code and user data safe • Compatibility : run well on older platform versions • Marketing : understand the market and your users (Hint : It doesn’t have to be expensive, but it can be) ANDROID BUILDING BLOCKS
• Resources : layouts, images, strings, colors as XML and
media files • Components : activities, services, and helper classes as Java code • Manifest : information about app for the runtime • Build configuration : APK versions in Gradle config files COMPONENT TYPES
• Activity = is a single screen with a user interface
• Service = performs long-running tasks in background • Content provider = manages shared a set of data • Broadcast receiver = responds to system-wide announcement THINK OF ANDROID AS A HOTEL
• Your app is the guest
• The Android System is the hotel manager • Services are available when you request them (intents) • In the foreground (activities) such as registration • In the background (services) such as laundry • Calls you when a package has arrived (broadcast receiver) • Access the city’s tour companies (content provider) HOMEWORK
• 1. Download Android Studio
• 2. Build Your First Android App in Java BIG PROJECTS
• Choose one of these titles:
• University Alumni Apps • University Scheduling and Meeting Apps ASSESSMENT CRITERIA
• User Requirement and Features in the App (10%) (Week 2 and 3)
• UI Mock Up Designs (10%) (Week 4) • Database and User Interface Design (25%) (Week 6 ) • First Presentation – Prototyping – User Review (20%) (Week 9) • Final Presentation and Running Apps (35%) (Week 13 and 14) Note : All members of the project teams are required to involved in each of their presentations ANDROID APP PROJECT
• Template of the project proposal:
• App Name Names of students in the team • Summary of the project (about half page) • Explain the major functions of the proposed app and the related theory. • Software architecture and User Interface Design (Some draft screen layouts to get you thinking about layout. The layouts can be handwritten for this milestone.)
• One group : 5 persons, consist of male and female.
• You can use any related programming language in Android programming such as : Java, Kotlin, C++, C#, Lua, Python, JavaScript, etc.