Kickstart Android
App Development
Nishant Srivastava
Android Dev/Interaction Designer
Organizer@GDG New Delhi
Agenda
- The Journey Begins: Understanding the basics
- Thing to do on the Journey: Activities & Intents
- Sight Seeing: Understanding the Android Interface
- Publishing the experience of the Journey
- Journey Bonus: It’s a surprise.
- The Journey Ends: Implementing the concepts learned
What is Android?
- Android is a software stack for mobile devices that includes an operating system, middle-ware and key applications.
- The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java Programming Language.
- The project responsible for developing the Android system is called the Android Open Source Project (AOSP) and is primarily lead by Google.
- Developed by Open Handset Alliance.
-
Android is NOT Linux
- No native windowing system
- no glibc support
- NO GNU/LINUX utilities
...so whats this Open Handset Alliance ?
- It’s a consortium of several companies
- Devoted to advancing open standards for mobile devices
- Develop technologies that will significantly lower the cost of developing and distributing mobile devices and services.
...How about an overview..
- Linux Kernel: memory management, process management, networking, and other operating system services.
- Native Libraries: written in C or C++, including: Surface Manager, 2D and 3D graphics, Media codes, SQL database, Browser engine, etc. only to be called by higher level programs
- Android Runtime: including the Dalvik virtual machine and the core Java libraries. (not J2SE/J2ME)
- Application Framework: Activity manager, Content providers, Resource manager, Notification manager
- Applications and Widgets: the real programs display information and interact with users.
Android platform components
Android platform components
Android in action
Android Flavours (or ver)
Security and Permissions
- Security between applications and the system is enforced at the process level through standard Linux facilities
- Application can't disrupt other applications, except by explicitly declaring the permissions for it
- Each Android package is given its own unique Linux user ID.
Android Apps
-
Built using Java and new SDK libraries
- No support for some Java libraries like Swing & AWT
- Oracle currently suing Google over use
-
Java code compiled into Dalvik byte code (.dex)
- Optimized for mobile devices (better memory management, battery utilization, etc.)
- Dalvik VM runs .dex files.
Android RunTime (ART)
- Android 5.0 uses the Android RunTime (ART) as runtime for all Android applications.
- ART uses Ahead Of Time compilation. During the deployment process of an application on an Android device, the application code is translated into machine code. This results in approx. 30% larger compile code, but allows faster execution from the beginning of the application.
- This also saves battery life, as the compilation is only done once, during the first start of the application.
Android Studio
Installing Android Studio
Gradle
Nooooo !! So much for Android , what next .... :(
-
Integration with Android Studio
-
A Single Build System
-
Android Signing Configuration
-
Multi-project Support
-
Full Incremental Builds
apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "example.gdg.kickstart_android" minSdkVersion 10 targetSdkVersion 21 versionCode 1 versionName "1.0" } }
Android Building Blocks
Finally ...a break ..
Android Manifest
- The components and settings of an Android application are described in the AndroidManifest.xml file. This file is known as themanifest file or the manifest.
- The manifest also specifies additional metadata for the application, e.g., icons and the version number of the application.
- This file is read by the Android system during installation of the application. The Android system evaluates this configuration file and determines the capabilities of the application
Activity
- Application Object
- Activity and Activity Lifecycle
- Activity Instance State
Intent
Intents are asynchronous messages which allow application components to request functionality from other Android components.
An intent can contain data via a Bundle. This data can be used by the receiving component.
Types of Intent
>Excplicit
Explicit intents explicitly define the component which should be called by the Android system, by using the Java class as identifier.
>Implicit
Implicit intents specify the action which should be performed and optionally data which provides content for the action.
User Interface & Layout Managers
List View
...and thats it for today folks!
Me after this session..literally :P
Services
- A service is a component which runs in the background without direct interaction with the user. As the service has no user interface, it is not bound to the lifecycle of an activity.
- Services are used for repetitive and potentially long running operations, i.e., Internet downloads, checking for new data, data processing, updating content providers and the like.
- By default, a service runs in the same process as the main thread of the application.
Broadcast Receivers
- A broadcast receiver (short receiver) is an Android component which allows you to register for system or application events. All registered receivers for an event are notified by the Android runtime once this event happens.
- For example, applications can register for the ACTION_BOOT_COMPLETED system event which is fired once the Android system has completed the boot process.
KEEP CALM
But First
Let Me Take
A
App