Skip to Content
Pro Android Apps Performance Optimization
book

Pro Android Apps Performance Optimization

by Hervé Guihot
January 2012
Intermediate to advanced
282 pages
7h 4m
English
Apress
Content preview from Pro Android Apps Performance Optimization

Assembly

The NDK allows you to use C and C++ in your Android applications. Chapter 2 showed you what native code would look like after the C or C++ code is compiled and how you could use objdump –d to disassemble a file (object file or library). For example, the ARM assembly code of computeIterativelyFaster is shown again in Listing 3–1.

Listing 3–1. ARM Assembly Code of C Implementation of computeIterativelyFaster

00000410 <computeIterativelyFaster>:  410:   e3500001       cmp     r0, #1  ;  0x1  414:   e92d0030       push    {r4, r5}  418:   91a02000       movls   r2, r0  41c:   93a03000       movls   r3, #0; 0x0  420:   9a00000e       bls     460 <computeIterativelyFaster+0x50>  424:   e2400001       sub     r0, r0, #1     ; 0x1  428:   e1b010a0       lsrs    r1, r0, #1 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Pro Android Graphics

Pro Android Graphics

Wallace Jackson

Publisher Resources

ISBN: 9781430239994Purchase book