Download presentation
Presentation is loading. Please wait.
Published byBarnaby Norton Modified over 9 years ago
1
Filip Debelić fdebelic@cs.hr
2
What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android, Inc. was founded in Palo Alto, California in October 2003 Google acquired Android Inc. on August 17, 2005. with it’s key employees On November 5, 2007, the Open Handset Alliance unveiled itself and unveiled Android The first commercially available smartphone running Android was the HTC Dream released in 2008 CS Computer Systems © 2015
3
Why Android? Android takes more then 80% of smartphone market Android powers hundreds of millions of mobile devices in more than 190 countries every day another million users power up their Android devices for the first time powerful development framework open marketplace for distributing your apps over one million Android applications published 1.5 billion application downloaded every month CS Computer Systems © 2015
4
Android SDK Android software development kit (SDK) includes a comprehensive set of development tools SDK manager, AVD manager, debugger, libraries, a handset emulator, documentation, sample code and tutorials until the end of 2014, the officially supported integrated development environment (IDE) was Eclipse (using the Android Development Tools (ADT) Plugin), but IntelliJ IDEA IDE and NetBeans IDE (via plugin) also supported Android development Android applications are packaged in.apk CS Computer Systems © 2015
5
Android Studio Android Studio is the official IDE for Android application development, based on IntelliJ IDEA Gradle-based build system Build variants and multiple apk file generation layout editor lint tools ProGuard and app-signing capabilities CS Computer Systems © 2015
6
java folder - java source code in packages res folder - resources drawable: pictures, icon, drawable xml layout: xml files describing screen components menu: xml files describing menus Values: xml resources with text, colors, dimensions, ids etc. AndroidManifest.xml - application configuration build.gradle – build configuration proguard-rules.pro – proguard configuration CS Computer Systems © 2015
7
User interface Android user interface is build using widgets (View) and layouts (ViewGroup) All user interface elements have: Id to excess element from source code Position of element on screen Padding around element Background picture or color onClick that defines method name for click event Rotation in degrees Visibility that can be visible, invisible or gone CS Computer Systems © 2015
8
Layouts LinearLayout - a layout that organizes its children into a single horizontal or vertical row. RelativeLayout - enables you to specify the location of child objects relative to each or to the parent FrameLayout - designed to block out an area on the screen to display a single item CS Computer Systems © 2015
9
Widgets TextView - element for displaying text EditText - an editable text field Button - a push-button that can be pressed, or clicked, by the user to perform an action. Checkbox - an on/off switch that can be toggled by the user. RadioButton - Similar to checkboxes, except that only one option can be selected in the group. ImageView – element for displaying image ProgressBar - visual indicator of progress in some operation CS Computer Systems © 2015
10
Activity An Activity is an application component that provides a screen with which users can interact in order to do something An application usually consists of multiple activities, and typically one activity is specified as the "main" activity Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack CS Computer Systems © 2015
11
Activity lifecycle CS Computer Systems © 2015
12
Creating an Activity create a subclass of Activity (or an existing subclass of it) implement callback methods that the system calls when the activity transitions between various states of its lifecycle onCreate() - the system calls this when creating your activity onPause() - the system calls this method as the first indication that the user is leaving your activity implement a user interface define a layout using views is with an XML layout file saved in your application resources set the layout as the UI for your activity with setContentView() declaring the activity in the manifest CS Computer Systems © 2015
13
Intent An intent is an abstract description of an operation to be performed, a messaging object you can use to request an action from another app component Explicit intents specify the component to start by name Implicit intents declare a general action to perform You can add extra data with various putExtra() methods, and get extra data with various getExtra() methods CS Computer Systems © 2015
14
Exercise Create Eggspert application for calculating time for egg cooking. Values that user must enter are: m – egg weight tE – egg temperature before putting in water tW – water temperature tT – target egg temperature Application must have two activities, one for entering input data and other for showing result Time is calculating with form: time = 0.451 * Math.pow(m, 2.0 / 3.0) * Math.log(0.76 * ((tE - tW) / (tT - W))); CS Computer Systems © 2015
15
Thank you Dropbox link: https://www.dropbox.com/s/k56iwgy208a5lqy/MyFirstApplication.zip?dl=0 Android developer: http://developer.android.com/index.html CS Computer Systems © 2015
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.