Vous êtes sur la page 1sur 41

Android* on Intel platforms

Daniel Holmlund
Gayathri Murali

Software and Services Group

Agenda

Introduction
Porting and Packaging for IA
Android Testing
Intel tools

Software and Services Group

Introduction

Software and Services Group

Committed to providing the best experience on IA


3X Faster1

6X Faster1

Best-in-class1

>20% Faster1

Android ICS Browser


GPU accelerated

Jscript Performance
X86 codegen

Optimized Android 2.3


Web Runtime

Optimized SKIA
Rendering Library

FPS: 20 60

Industry Leader

CES 2012 Review

Android 2.3

Intel is the number one contributor to Linux kernel.

Intel is working on Android 64 bit operating system.

Intel recognized as the #1 external contributor2 to Jelly Bean.


In line to be #1 again for next Android release

Chrome browser ported to Android and optimized to run best on IA

Intel has contributed 750+ patches to Webkit (Drives the browser for Android and iOS)
in the last two months and is the 2nd largest Contributor to Chromium behind Google

Creating cross-platform tools and development environments based on new


programming models

Software and Services Group

Optimizing Android for Intel


Atom Processor-Based Devices
We optimize web
technologies such as
HTML 5, WebKit and
JavaScript

Apps

Apps

GPU & Video support


for canvas operations

Home

Contacts

Phone

Browser
Extensive middleware
development in imaging,
media and DRM deliver
compelling media
Content Providers
View System
experiences

Application
Framework

User
Experience

SKIA and openGL


optimizations
Activity Manager

Package Manager

Windows*
Manager
Telephony
Manager

Resource
Manager

Location Manager

Operating
System

Middleware

Libraries

Notification Manager

Apply our extensive


experience
optimizing Java* to
the Dalvik* VM

Android* Runtime

Surface Manager

Media
Framework

SQLite

OpenGL* ES

FreeType

WebKit

Memory Optimizations, AVI,


DivX*, and ASF container types,
WMV SGL
/VC-1 decoder. Live SSL
Streaming optimizations, HDMI
and WiDI Extended Video
Modes, Video Playback DRM

Core Libraries

Dalvik Virtual Machine

libc

Enhanced debugging
and logging

IA assembly
optimizations

Linux* Kernel

Display Driver

Camera Driver

Flash Memory
Driver

Binder (IPC) Driver

Keypad Driver

WiFi Driver

Audio Drivers

Power Management

Based on third party validation and sampling of Android apps using specific computer systems and/or components and reflect the approximate performance of Intel products as
measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance and/or results.

Software and Services Group

Drivers validated &


optimized for power
& memory footprint

Smartphones with Intel Inside - 2013


Z2560

Z2420
Intel Yolo

ASUS* Fonepad 7

ASUS Fonepad Note FHD - 6

Z2580
Lenovo* K900 5.5

ZTE* Geek 5

Acer Liquid C1

Software and Services Group

ZTE Grand X2 4.5

Tablets with Intel Inside - 2013


ASUS* MeMO Pad FHD 10

(Z2560)

Samsung* Galaxy Tab 3 10.1

(Z2560)

ASUS* Fonepad
7

Dell* Venue 7

(Z2420)

ASUS* Transformer Book Trio


Atom Z2580 + Core i7 4th Generation

Software and Services Group

Porting and Packaging for IA

Software and Services Group

NDK application
Good news! Most NDK applications run as it as on x86 platforms
Port your applications to improve performance and reliability
NDK applications categorized to 3 types

Consists of C/C++ code only that is not related to hardware


Recompile the native code to run the application on the Intel Atom platform successfully.
Open the NDK project and search for Android.mk file and add APP_ABI := armeabi
armeabi-v7a x86 in Android.mk and re-build the native code with ndk-build.

Uses a third-party dynamic linked library


the shared library must be recompiled into x86 version for the Intel Atom platform.

Includes assembly code that is highly related to non-IA platforms


code must be rewritten with IA assembly or C/C++.

Use the header file here to convert all NEON instructions into SSE instructions.

Software and Services Group

NDK Application Demo

Software and Services Group

Porting Dalvik applications


Dalvik applications run without any changes on
all Intel powered devices
For a high resolution device, change the default
memory allocation to meet application
requirements

Software and Services Group

Packaging APKs for multiple CPU


architectures
Two options:
One package for all (fat binary)
PIDs

PSI

Embed native libraries for each architecture in one


APK
Easiest and preferred way to go.

TS

Multiple APKs
One APK per architecture
If you have good reasons to do so (ie your fat binary
APK would be larger than 50MB).

Software and Services Group

Fat Binaries
The application will be filtered on ABI support during installation
(after download).
Use lib/armeabi libraries

Use lib/armeabi-v7a libraries

Use lib/x86 libraries

Software and Services Group

Version code convention (proposal)

APKs that targets different platforms must have


different version codes.
The store will choose the compatible APK with
the higher version code number.
Using this convention, the chosen APK will be
the one that run best on the device.
Software and Services Group

Android Testing

Software and Services Group

Options available to test


Emulators
Part of the SDK or stand alone emulators that aids in testing
application in your development environment.
An Emulator mimics the hardware and software features of a
typical mobile device
Cloud based testing
Actual devices are available on cloud for testing
Developers can create test scripts and run the tests on cloud on
actual devices
Real device testing
Developers have access to the actual device to test the
application functionality

Software and Services Group

Emulators - Create and starting


AVD

Launch the Android Virtual


Device Manager: In Eclipse,
click Android Virtual Device
Manager from the toolbar.
In the Android Virtual
Device Manager panel,
click New.
Fill in the details
Make sure you select an
API that is supported by an
x86 system image,
CPU/ABI is set to x86, and
you have enabled GPU
(OpenGL ES*) emulation.
You can launch the x86
AVD by clicking on Start,
then Launch.

Software and Services Group

Cloud based testing


A device laboratory of multiple real devices are available for the
developers to test
A test is carried out on the cloud based on test scripts either created
by the developers or built in test scripts provided the service
provider
There may be a cost associated in using the devices
Developers may not be able to see the actual test in progress, but
gets a detailed report out with screenshots
Ability to adopt to changing condition
Scale up and down

Software and Services Group

Real device testing on Cloud - AppTHwack


AppTHwack provides real device testing services on Android, iOS
and other mobile web apps.
AppTHwack maintains a device lab with almost all devices available
in market which are available for a period of testing. Users can
either use the built in test created by AppTHwack to test their apps
or create a custom test script.
Check out the pricing details here
Intel Software sponsors free testing of devices running on Intel
platforms.
Check out the device lab here

Software and Services Group

Intel Hardware Accelerated


Execution Manager (HAXM)

Software and Services Group

Faster Android Emulation using an IA-based host


PC
Pre-built Atom Images
Android SDK manager has x86 emulation
images built-in
To emulate an Atom-based Android phone,
install the Intel Atom x86 System Image
available in the Android SDK Manager

Much Faster Emulation


Intel Hardware Accelerated Execution Manager
(HAXM) for Mac and Windows uses Intel
Virtualization Technology (VT) to accelerate
Android emulator by 2-4x
Intel VT is already supported in Linux* (KVM) for
x86.
See www.intel.com/software/android for demo
videos & installation tips
Software and Services Group

Intel x86 Atom


System Image

Intel x86
Emulator
Accelerator

Intel HAXM - DEMO

Software and Services Group

Intel Graphics Performance


Analyzers

Software and Services Group

Intel Graphics Performance Analyzers


System Analyzer for Android

Real-time system-level performance


analysis for Intel-based Android devices
Immediate experiments and overwrites
enable developers to isolate CPU and
GPU performance problems
Metrics for CPU, GPU, API, memory,
network, power, etc.

25

Software and Services Group

For on-device app testing: Intel GPA System


Analyzer
Real-time Remote Performance and Power Profiling
Real-time charts:

CPU metrics
Graphics API level metrics
Processor graphics hardware metrics
Power metrics

Data
Android
Smart
Phone

Intel GPA System


Analyzer running on
a PC

USB adb Connection


Wi-Fi Connection
Download Intel GPA for FREE at intel.com/software/GPA

Copyright 2012, Intel Corporation. All rights reserved.


*Other brands and names are the property of their respective owners.

Intel GPA - DEMO

Software and Services Group

Intel HTML5 Development Environment


(XDK)
Create, Debug and Build HTML5 apps for multiple platforms from a single
code base.

more on:
html5dev-software.intel.com
Software and Services Group

Intel Threading Building Blocks


(TBB)

Software and Services Group

Key Features of TBB


You can specify tasks instead of manipulating
threads
TBB maps your logical tasks onto threads with full
support for nested parallelism

Targets threading for scalable performance


Uses proven efficient parallel patterns
Uses work-stealing to support the load balance of
unknown execution time for tasks.

Open source and licensed versions available on


:
Linux, Windows, Mac OS X* and Android*
30

Software and Services Group

Intel TBB Integration


#for including tbb in your project:
Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := tbb
LOCAL_SRC_FILES := $(TBB_PATH)/lib/android/libtbb.so
LOCAL_EXPORT_C_INCLUDES := $(TBB_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)
#for calling tbb from your lib:
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_SHARED_LIBRARIES += tbb
LOCAL_CFLAGS += -DTBB_USE_GCC_BUILTINS -std=c++11
APP_ABI := x86
APP_STL := gnustl_shared
System.loadLibrary("gnustl_shared");
System.loadLibrary("tbb");
System.loadLibrary("YourLib");

Software and Services Group

Application.mk

Java

Intel TBB - Download


GPLv2 with runtime exception available from
threadingbuildingblocks.org/download :

The commercial version with support is here:


software.intel.com/en-us/intel-tbb

Software and Services Group

Where to Get More Info

Intel Developer Zone (IDZ)

Real developers sharing knowledge and


offering help
Dedicated communities and forums
focused on your interests
Worldwide reach
News and insights on cutting edge
technology

Intel Android* Developer Website

Great content you wont find anywhere else


Technical articles, tools, and How-To
guides
Native app porting tips & case studies
Info on x86 emulator and Intel Hardware
Accelerated Execution Manager
Active forums and blogs written by Intel and
community experts

software.intel.com/android

Copyright 2012, Intel Corporation. All rights reserved.


*Other brands and names are the property of their respective owners.

Backup

Software and Services Group

Intel C++ Compiler for Android

Software and Services Group

Intel C++ Compiler


Optimized System and Application Performance
High Performance

Boosts performance with a single recompile


Binary and source compatible with GNU* GCC compiler
Intel Cilk Plus - task and data parallelism
Standards support
Optimization
Intel Atom - optimized common libc/libm functions
Streaming SIMD Extensions 3 (SSE3) instruction support
Vectorization support
Interprocedural optimization
Profile guided optimization

High performance. GNU compatibility. Standard support.


36

Software and Services Group

Most Android* Apps Will Just Work on Atom


Android Runtime

Android Dalvik and HTML5 apps

These should just work we do extensive testing of


pre-production systems

Dalvik Virtual
Machine
Core Libraries

Android native (NDK) apps

Most will run w/o any recompilation but


A simple recompile using the Android NDK yields the best performance
If the developer uses ARM-specific features, add equivalent Intel SSE
features

Top Android Market apps

Intel validates and tests on Intel Atom processor platforms


(Mix of Dalvik and native (NDK) apps)

Software and Services Group

Optimization

Use Inline instead of Frequently Used Short


Use Float instead of Double

Multi-thread coding

The Intel Atom platform has FPU enabled. In most cases, using Float instead of
Double speeds up the data computing process and saves memory bandwidth in
Intel Atom processor-based devices.
Multi-thread coding allows you to use the hyper-threading function of the Intel Atom
processor to increase throughput and improve overall performance

High Performance compiler flags


Adding specific flags according to your target platform is highly
recommended. You can add the following recommended flags during
compilation on the Intel Atom platform:
-march=atom
-msse4
-mavx
-maes

Software and Services Group

Intel VTune Amplifier for Android

Software and Services Group

Intel VTune Amplifier XE 2013


Performance & Power Profiler
Where is my application
Spending Time?

Focus tuning on functions


taking time
See call stacks
Drill to source and asm code

Wasting Time?

See cache misses on your


source
See functions sorted by
# of cache misses

Consuming Power?

See Frequency and


Sleep states
See Wakeup reasons

Advanced profiling for Android Mobile Devices


Software and Services Group

Intel VTune Amplifier XE 2013


CPU Performance Analysis
Identify Hotspots and inefficient code
Cache Misses, Branch Mispredictions

Drill down from Java & C/C++ to assembler code

Software and Services Group

CPU Power Analysis


Use case: Collecting data from sensor
Continuously collecting accelerometer data
Use power analysis to find out impact of
sampling frequency

SENSOR_DELAY_FASTEST

SENSOR_DELAY_NORMAL

Lowest Power
consumption

High Power
consumption
Software and Services Group

2/11/201

Vous aimerez peut-être aussi