Of Bytes, Cycles and Battery Life. Who am [2] [1]

Slides:



Advertisements
Similar presentations
Paging: Design Issues. Readings r Silbershatz et al: ,
Advertisements

Introduction.  Professor  Adam Porter 
Android Tools & Wireless ADB Αντρέας Λύμπουρας Θεόφιλος Φωκάς Ζαχαρίας Χ’’Λάμπρου.
Pete Houston Maintenance, Improvement, Patch, Optimization, Errors, Bugs, …. oh I’m totally FUCKED UP! Coders tend to make many.
Fixing Memory Leaks in Android Applications using DDMS & MAT Presented by Sravankumar Reddy Javaji CS286 Mobile Programming.
DEPARTMENT OF COMPUTER ENGINEERING
ANDROID OPERATING SYSTEM Guided By,Presented By, Ajay B.N Somashekar B.T Asst Professor MTech 2 nd Sem (CE)Dept of CS & E.
Debugging Android Applications
Android Tutorial Android Written in Java Utilizes Dalvik VM – Just in time (JIT) compilation since Android 2.2.
SET UP COMPUTER ** PLEASE BE AWARE SCREENSHOTS MAY NOT MATCH **
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android Introduction Platform Overview.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Basic Input Output System
Bruce Kennedy Really mobile computing Experiences with a Series 3c Bruce Kennedy 17 Dec 2001.
Presented by: Kushal Mehta University of Central Florida Michael Spreitzenbarth, Felix Freiling Friedrich-Alexander- University Erlangen, Germany michael.spreitzenbart,
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
Daniel, Stephen & Thomson 1. » Easy for learners to create mobile apps for Android smart phones » Visually fitting together puzzle piece-shaped "programming.
Is Your Mobile App Secure. DEF CON 23 Wall of Sheep Sat
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Developing Cross-Platform Applications with Visual Studio 2015
Tennis for Two, 1958, by William Higinbotham, Brookhaven National Lab CSE 380 – Computer Game Programming Graphics Device Management.
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
Kenneth Hurley Sr. Software Engineer
Android for Java Developers Denver Java Users Group Jan 11, Mike
CS 425 Game Programming I Jan M. Allbeck. Outline  Introductions  Expectations  Tools and setup  Quick introduction to C++ and Visual Studio  What.
Eclipse Tutorial Barrett Summer Scholars 2011 Sustainable Engineering: Learning to Engineer Truly Green Products.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
XP Tutorial 12 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Special Effects Creating Rollovers, Menus, Filters, and Transitions.
Mobile Application Optimization. Sanath Nandasiri Programmer.(Not a singer) (Exilesoft)
Problem of the Day  Why are manhole covers round?
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Android Studio IDE Tools Operation Summary. icle.html icle.html.
Slides and projects at samsclass.info. Adding Trojans to Apps Slides and projects at samsclass.info.
CHAPTER 1 Introduction. Chapter objectives: Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
XP Tutorial 5 New Perspectives on JavaScript, Comprehensive1 Working with Special Effects Creating Rollovers, Menus, Filters, and Transitions.
By, Rutika R. Channawar. Content Introduction Open Handset Alliance Minimum Hardware Requirements Versions Feature Architecture Advantages Disadvantages.
Intoduction to Andriod studio Environment With a hello world program.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
Mobile Application Development. What You Should Know About Android Studio 2.0.
Best 5 Mobile App Development Tools for Developer's to think beyond the Limitation.
By: Dylan Small.  History of Android  Android Versions  Technical Specs  New/Current Versions  Future of Android  Summary Road Map.
Lesson 1 – Getting Started with App Inventor
3 Important Performance tracking tools in an Android Application Development Workflow Here are 3 tools every Android application developer should familiarize.
Android. Android An Open Handset Alliance Project A software platform and operating system for mobile devices Based on the Linux kernel Developed by Google.
Memory Management for Android Apps Min Ji, Kim Embedded Software Lab.
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
Introduction to Android Chapter 1 1. Objectives Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
A presentation on Android and Android project Around Me
Android.
Obtaining the Required Tools
Android Runtime – Dalvik VM
Chapter 5: Using System Software
Android Studio, Android System Basics and Git
APK Downloader
Sci Vis I Exam Review Unit 6 File Formats.
Advanced Graphics Algorithms Ying Zhu Georgia State University
Development-Introduction
Contents: Introduction Different Mobile Operating Systems
Mobile Handset Virtual Machine
Optical Character Recognition
Windows Phone: Optimizing Application Performance
CHAPTER 1 Introduction Chapter objectives: Understand what Android is
Android Developer Fundamentals V2
The Most Popular Android UI Automation Testing Tool Andrii Voitenko
Korea Software HRD Center
Android Platform, Android App Basic Components
Mobile Programming Dr. Mohsin Ali Memon.
Automating Memory Management
Presentation transcript:

Of Bytes, Cycles and Battery Life

Who am [2] [1]

How to reduce your APK size Memory Analysis Tools Performance Analysis Tools What i‘ll talk about

Reduce asset size – pngcrush your PNGs [3] – SVG (YMMV) [4] – lower bit-rates for audio Reduce code size – Remove unnecessary dependencies! – Proguard, for Class files [5] [6] – Dexguard, for Dex files [7] How to reduce your APK size

Multiple-APKs to the „rescue“ [8] – One APK per screen density – One APK per texture compression algorithm – Use Google Play filters – Easier with new Android Gradle build system APK Expansion files [9] – hosted by Google Roll your own „Expansion files“ – Avoid if you can! „But i can‘t reduce my APK size“

Memory Analysis Tools „But we have a Garbage Collector!“ – You can still „leak“ memory – Nasty static vars referencing unused objects – Hidden object references – Native memory allocated by Java classes If you write games, GC kills your steady framerate

DDMS [10] Heap View

DDMS Allocation Tracker

HPROF/Eclipse MAT [11] Select the process Click Save to a location of your choice Convert to „real“ HPROF file Open in Eclipse MAT [12]

HPROF/Eclipse MAT

Performance Analysis Tools Why do we want to analyse? – Jerky animations – Do less, conserve battery – Better user Experience What do we want to analyse? – Time spent in Java code – Time spent in Native code – Time spent drawing stuff

Before we start... Never use the emulator! – Ever, think of the kittens Identify hotspots in your app, not in microbenchmarks Only spend time if you have a real problem

Java Profilers DDMS – Quite capable method level profiler – Good enough for 99% of use cases – Works with any Android version 4.1+ Profiling tools – Systrace [13], More powerful, also tracks OS calls Needs root and Android 4.1+ – We‘ll check out the graphical parts later

DDMS Start app Navigate to problematic activity, hit Wait a bit, hit View profiling data – Ignore absolute time, only care for relative timings – Ignore trivial getters/setters, instrumentation messes with timings

DDMS

Native Code Profilers Android NDK Profiler [14] – Not an official NDK tool – Setup a bit involved Device specific CPU profilers – NVIDIA Nsight [15],... Roll your own – Instrument manually – Track down hotspots

Graphics Profilers What do we analyse? – Overdraw, your biggest enemy – Draw calls, your second biggest enemy Use DDMS/systrace – Related to memory Textures on VRAM (which is usually RAM) Bitmaps in RAM

Graphics Profilers 4.1+ Profiling tools GPU Vendor Specific – NVIDIA [16], Qualcomm [17], Imagination Technologies [18] – Outside of scope of this talk

Visualize Overdraw [19]

Visualize Overdraw Normal Color – 0 Overdraw Blue – 1x Overdraw Green – 2x Overdraw Light Red – 3x Overdraw Dark Red – +4x Overdraw

Visualize Overdraw Hierarchy View [20] Window -> Open Perspective -> Other...

Visualize Overdraw

Tracer for OpenGL [21] Window -> Open Perspective -> Other... Click Enter package name Wait

Visualize Overdraw

Closing Words So much to tell, so little time See Dalvik Performance Tips [22] Read all references – Your users will thank you for excellent battery life and buttery smooth UIs

FIN Thanks for Listening Questions?

References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

References [12] [13] [14] [15] [16] [17] and-resourceshttps://developer.qualcomm.com/mobile-development/mobile-technologies/gaming-graphics-optimization-adreno/tools- and-resources [18] [19] [20] [21] [22]