Android 101 נושאי ההרצאה: מה זה ?Android מהם כלי העבודה?

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Bruce Scharlau, University of Aberdeen, 2010 Android UI, and Networking Mobile Computing Based on android-sdk_2.2 Unless otherwise stated, images are from.
Android OS : Core Concepts Dr. Jeyakesavan Veerasamy Sr. Lecturer University of Texas at Dallas
Joemarie Comeros Amparo Android Development Orientation for Starters.
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Android Tools & Wireless ADB Αντρέας Λύμπουρας Θεόφιλος Φωκάς Ζαχαρίας Χ’’Λάμπρου.
The Android Development Environment.  Getting started on the Android Platform  Installing required libraries  Programming Android using the Eclipse.
ANDROID OPERATING SYSTEM Guided By,Presented By, Ajay B.N Somashekar B.T Asst Professor MTech 2 nd Sem (CE)Dept of CS & E.
Android and Project Structure. Android Android OS – Built on Linux Kernel – Phones – Netbooks – Readers – Other???
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
Mobile Application Development
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
Android Tutorial Android Written in Java Utilizes Dalvik VM – Just in time (JIT) compilation since Android 2.2.
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
2. Setting Up Your Android Development Environment.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
UFCFX5-15-3Mobile Device Development Android Development Environments and Windows.
Android Tutorial Larry Walters OOSE Fall References This tutorial is a brief overview of some major concepts…Android is much richer and more complex.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android UI, and Networking. Can do most networking on Android Bluetooth only on 2.0, Not supported with version 1.6.
Android Introduction Platform Overview.
Intro to Android Programming George Nychis Srinivasan Seshan.
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
CS5103 Software Engineering Lecture 08 Android Development II.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
Take a leap towards the most promising technology
Android Info mostly based on Pro Android 3.  User Applications  Java Libraries – most of Java standard edition ◦ Activities/Services ◦ UI/Graphics/View.
Java Android-8 Imran Shafi. Lecture Contents  Debugging Android Projects  Java/XML Errors  Debugger  Logcat Utility  Android Debug Bridge (adb) 
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
Mobile Application Development using Android Lecture 2.
DUE Hello World on the Android Platform.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
Activities and Intents. Activities Activity is a window that contains the user interface of your application,typically an application has one or more.
Android for Java Developers Denver Java Users Group Jan 11, Mike
Android Boot Camp for Developers Using Java, 3E
Configuring Android Development Environment Nilesh Singh.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
1 Android Introduction Platform Overview. 2 What is Android?  Android is a software stack for mobile devices that includes an operating system, middleware.
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Services Background operating component without a visual interface Running in the background indefinitely Differently from Activity, Service in Android.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
Mobile Application Development Data Storage. Android provides several options for you to save persistent application data. The solution you choose depends.
Introduction to Android Programming
Mobile Device Development
Android 01: Fundamentals
Instructor: Mazhar Hussain
Android Studio, Android System Basics and Git
Android.
MAD.
Android Mobile Application Development
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
CA16R405 - Mobile Application Development (Theory)
CMPE419 Mobile Application Development
Android training in Chandigarh. What is ADB ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator.
CS5103 Software Engineering
Application Development A Tutorial Driven Course
Emerging Platform#3 Android & Programming an App
Mobile Programming Dr. Mohsin Ali Memon.
Android Development Introduction to Android Development 2011/01/16
CMPE419 Mobile Application Development
CA16R405 - Mobile Application Development (Theory)
Presentation transcript:

Android 101 נושאי ההרצאה: מה זה ?Android מהם כלי העבודה? איזה כלים יש בשביל? Debugging

What’s Android? An open source mobile operating system.

Open sourced – by how much? AOSP – Android Open Source Project.

AOSP Glossary Custom ROM - customized and improved from an existing android ROM. Cooked ROM – built from the AOSP source code (from scratch).

Other AOSP uses “Android TV” and AOSP STBs. Generic AOSP tablets, phones.

Exotic AOSP uses Android X86 – porting android on to X86 devices such as PCs. Why? Cheap. Common. Strong.

US Army trusts AOSP First army approved smart phone chose a Sony Xperia with a modified ROM.

Android tools. What’s given by Android for development? ADB. AVD manager and emulator. Android devices. SDK. NDK.

Android tools – ADB. The “Android Debug Bridge” is: A command line tool. handles communication with a development unit a client-server program that includes three components: A client, which runs on your computer. A server, which runs as a background process. A daemon, which runs as a background process on each development unit.

Android tools – Emulator. Runs on your computer. Mouse/keyboard to mimic touch and key events. Mimics all hardware and software features. Different screen sizes and densities. Emulating phone events (SMS, phone calls). Spoofing location events. Different API levels.

Android tools – Emulator.

Android tools – Device. All android devices are debug-able via USB “out of the box” (no root is needed). To enable: Settings>applications: Allow unknown resources. Settings>applications>development: Allow USB debugging. Stay awake.

Android tools – SDK. Programming language: JAVA + XML. Create standard android application by using and utilizing the applications framework. Most popular IDE: Eclipse + ADT. Other possible IDEs: intellij. Net beans.

Android tools – NDK. Programming language: everything! Create an android application by accessing the native code directly. Reasons for using NDK: Using non-java ready made code. Using hardware acceleration. A real need for more performance.

Android building blocks The components of an android application and their connecting methods.

The (Android) application. An application consists of A manifest xml. A set of: Activities. Services. Broadcast receivers. Content providers.

The Manifest The Manifest is essentially a list of components that the application uses or requires, such as: The components of the applications. User permissions . The minimum API level. Hardware and software features. API dependencies.

A manifest example

.The Activity An activity represents a single screen with a user interface (Java file + xml layout file). An application usually consists of multiple activities that are loosely bound to each other. One Activity is flagged as “main” and it is started at the application launch time. An Activity can launch other activities to create an app UI workflow. The Activity has an Intent attribute that determines how android treats it.

Activity explained with an example. A screen that displays a list of emails. A screen that displays a single email. A screen that enables you to compose an email. Each and every one of these is an Activity!

Starting an Activity. When you press reply: The compose Activity gets called. The recipients are sent via the “Extras” attribute of the intent.

The Activity life-cycle. There are 6 stages in the Android Activity life cycle. These stages allow you to perform tasks in their correct time of the workflow.

The Activity life-cycle vol2.

The Activity life-cycle vol3 – before example. SharedPrefs – A tool that saves data to a file so it will be available even if the app is closed and restarted. It is generally used for: 1. Saving user preferences. 2. Saving a “snapshot” of the app so it could be resumed to precisely the same state.

The Activity life-cycle vol3 – example of use.

Describe the static layout of a screen. A few types available: The Activity – Layout. Consists of xml. Describe the static layout of a screen. A few types available: LinearLayout – children are lined up automatically. RelativeLayout - children order needs to be defined. ListView – children are items of a list. Etc.

The Activity – Layout example.

.The Service An application component that can perform long-running operations in the background and does not provide a user interface. The service has two forms: A "started“ service is called by an app component and runs in the background even if the application that called it was closed. A “bound” service is bound by an app component and is used as a client-server bridge, this sort of service is terminated when the application that is bound to it is closed.

Starting a service. From the activity perform: The startService() method returns immediately. If the service is not already running, the android system calls onCreate(), then calls  onStartCommand() else it only calls the onStartCommand() method.

The service life cycle. The same principle as in the activity life cycle applies here only the stages are different. As you can see the bound and started services have a similar cycle with a twist: The bound service is only “alive” while the binding application is “alive”.

The service life cycle.

The Broadcast receivers. a component that responds to system-wide broadcast announcements. The announcement can originate either from a system event (screen on/off) or a custom activity event. When this protocol is customized it facilitates message sending between applications and activities that should work together.

The Broadcast receivers - example. The manifest tag:

The Broadcast receivers - example. The broadcast receiver file:

The Content providers. Components that manage a shared set of application data. The data is stored at one of the following formats: In the file system. In an SQLite database. on the web. More.. Essentially you can store it in any persistent storage location your application can access.

The Content providers. Through the content provider, other applications can query or even modify the data (if the content provider allows it). providers are also useful for reading and writing data that is private to your application and is not shared.

The Content providers – examples. Here’s a few examples for system content providers: Contacts. Text messages. Phone calls.

Android debug tools. Android provides a few precious tools for that: DDMS. Logcat. Hierarchy viewer. Monkey & monkey runner.

Android debug tools – DDMS. The “Dalvik Debug Monitor Server (DDMS)” is: A debugging tool that provides: Port forwarding services. Screen capture.  thread and heap information.  Logcat and process logging. Mobile data spoofing (location, calls and SMS) Memory dump.

Android debug tools – DDMS.

Android debug tools – Logcat. A mechanism for collecting and viewing system debug output. Filter levels: V — Verbose (lowest priority) D — Debug I — Info W — Warning E — Error Invoke logs with a custom TAG in your app to monitor its operation:

Android debug tools – Hierarchy viewer.  Displays the View objects that form the UI of the Activity that is running on your device or emulator.  Start command: <sdk>/tools/hierarchyviewer If #levels > 7 -> NOT GOOD!

Android debug tools – Monkey. Creates random UI events. Great UI durability test. You can configure: The amount of event. Percentage of touch/motion/track/key events. The monkey’s “aggressiveness” (die after exception/error/security error etc.).

Android debug tools – Monkey runner. Enables using the monkey tool in a more precise way: Write a python code. The monkey performs it. Great for recreating bugs and create tests to see when they are resolved.

Tips and pointers - ANR. “Activity not responding”: Appears if: Why? 5 seconds of no action after a touch event. 10 second after invoking a BR it hasn’t finished working. Why? Every activity has 1 UI thread and if it is stuck the UX suffers.

Tips and pointers – Avoid ANR. Everything that isn’t a UI action shouldn’t be on the UI thread, use: AsyncTask. TimerTask. Handler. Scheduled task. Thread. Then post your data on the UI thread.

Tips and pointers – example. Create an AsyncTask: start an AsyncTask:

Tips and pointers – Multiple screens. Many different devices = Many different screen sizes. Prepare by: Use wrap_content, fill_parent, or dp units for layouts (no PX reframe from hardcoded values altogether). Test on many different Emulator instances. Use 9patch images (they stretch correctly). Add per-resolution drawable resource folder: -  layout-small/… - layout-xlarge/..

Tips and pointers – location detection. 3 main possibilities: GPS. Most accurate. Wireless networks. Gives faster results. Costs less battery. Works inside buildings. Cell towers. Always available.