Android NDK. Beginner's Guide. Sylvain Ratabouil. Discover the native side of Android and inject the power of C/C++ in your applications PUBLISHING

Similar documents
A Study on Android development kits and the Phone Gap Framework

Running a Program on an AVD

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Des Moines Area Community College

How To Develop For A Powergen 2.2 (Tegra) With Nsight) And Gbd (Gbd) On A Quadriplegic (Powergen) Powergen Powergen 3

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Computer Graphics on Mobile Devices VL SS ECTS

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Android Development: Part One

Android NDK Native Development Kit

Building graphic-rich and better performing native applications. Pro. Android C++ with the NDK. Onur Cinar

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

Cookbook. Flash ios Apps. Christopher Caleb. 100 practical recipes for developing ios apps with Flash Professional and Adobe AIR PUBLISHING MUMBAI

Mobile Phones Operating Systems

Lecture 1 Introduction to Android

Cross-Platform Game Development Best practices learned from Marmalade, Unreal, Unity, etc.

Multithreading and Java Native Interface (JNI)!

An Introduction to Android

Development_Setting. Step I: Create an Android Project

Game Development in Android Disgruntled Rats LLC. Sean Godinez Brian Morgan Michael Boldischar

How To Develop Android On Your Computer Or Tablet Or Phone

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

ITG Software Engineering

Beginning Android 4. Games Development. Mario Zechner. Robert Green

Introduction to Android Development. Jeff Avery CS349, Mar 2013

TEGRA X1 DEVELOPER TOOLS SEBASTIEN DOMINE, SR. DIRECTOR SW ENGINEERING

Introduction to Android Development. Ed Burnette

Accelerate your Mobile Apps and Games for Android on ARM. Matthew Du Puy Software Engineer, ARM

Hands- On Training for Android and ios Software Developers

OMX, Android, GStreamer How do I decide what to use? 15 July 2011

System Reference 2013

Finding Performance and Power Issues on Android Systems. By Eric W Moore

[PACKTl. Flash Development for Android Cookbook. Flash, Flex, and AIR. Joseph Labrecque. Over 90 recipes to build exciting Android applications with

DEVELOPING MOBILE APPLICATIONS USING ANDROID

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Overview of CS 282 & Android

Introduction to Native Android Development with NDK

Example of Standard API

ANDROID INTRODUCTION TO ANDROID

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Getting Started with Tizen SDK : How to develop a Web app. Hong Gyungpyo 洪 競 杓 Samsung Electronics Co., Ltd

Android Programming and Security

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Module Title: Software Development A: Mobile Application Development

An Introduction to Android. Huang Xuguang Database Lab. Inha University

Android (Basic + Advance) Application Development

Running Android Applications on BlackBerry 10 developer.blackberry.com/android

Development With ARM DS-5. Mervyn Liu FAE Aug. 2015

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Android in Action. Second Edition. Revised Edition of Unlocking Android MANNING. (74 w. long.) W. FRANK ABLESON CHRIS KING ROBI SEN.

Here to take you beyond Mobile Application development using Android Course details

Pro Windows Phone 7. Development. Rob Cameron

Developing multi-platform mobile applications: doing it right. Mihail Ivanchev

Introduction to Android

Introduction to Android

Overview. The Android operating system is like a cake consisting of various layers.

Praktikum Entwicklung Mediensysteme (für Master)

Android Basics. Xin Yang

CS378 -Mobile Computing. Android Overview and Android Development Environment

Developing Google Android Mobile Clients for Web Services: a Case Study

Android Development: a System Perspective. Javier Orensanz

Using Microsoft Visual Studio API Reference

Tutorial on OpenCV for Android Setup

STLinux Software development environment

Software development. Development requirements. Java. Android SDK. Eclipse IDE (optional)

Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

GPU Profiling with AMD CodeXL

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Praktikum Entwicklung von Mediensystemen (Android)

Rapid Game Development Using Cocos2D-JS

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Practical Android Projects Lucas Jordan Pieter Greyling

Tec: A Cross-Platform Game Engine

Android Operating System

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

Introduction to Android

Android Application Development

OpenCV on Android Platforms

The power of root on Android emulators

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Research and Design of Universal and Open Software Development Platform for Digital Home

NVIDIA Tegra Android Platform Support Pack Getting Started Guide

Performance Optimization and Debug Tools for mobile games with PlayCanvas

LibGDX játék fejlesztése és publikálása Google Play-en. Vörös Viktor, NNG

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Developing Applications for ios

Discovering new features in HTML5 Offline applications

Workshop on Android and Applications Development

Instrumentation Software Profiling

Mobile App Design and Development

«compl*tc IDIOT'S GUIDE. Android App. Development. by Christopher Froehlich ALPHA. A member of Penguin Group (USA) Inc.

The Decaffeinated Robot

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Fahim Uddin 1. Java SDK

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Hacking your Droid ADITYA GUPTA

Transcription:

[ PUBLISHING Android NDK Beginner's Guide Discover the native side of Android and inject the power of C/C++ in your applications Sylvain Ratabouil BIRMINGHAMMUMBAI

installing installing preparing installing setting setting compiling Preface 1 Chapter 1: Setting Up your Environment 7 Getting started with Android development 7 Setting up Windows 8 preparing Windows for Android development 8 Installing Android development kits on Windows 12 Setting up Android SDK and NDK on Windows 13 Mac OS X 18 preparing Mac OS X for Android development 18 Installing Android development kits on Mac OS X 20 Android SDK and NDK on Mac OS X 20 Setting up Linux 22 Ubuntu Linux for Android development 22 Installing Android development kits on Linux 27 installing Android SDK and NDK on Ubuntu 27 Setting up the Eclipse development environment 29 Eclipse 29 Emulating Android 33 creating an Android virtual device 33 Developing with an Android device on Windows and Mac OS X 37 up your Android device on Windows and Mac OS X 37 Developing with an Android device on Linux 39 up your Android device on Ubuntu 39 Troubleshooting a development device 42 Summary 43 Chapter 2: Creating, Compiling, and Deploying Native Projects 4J> Compiling and deploying NDK sample applications 46 and deploying the hellojni sample 46

building running invoking creating Exploring Android SDK tools 51 Android debug bridge 51 Project configuration tool 54 Creating your first Android project using eclipse 56 initiating a Java project 56 Introducing Dalvik 59 Interfacing Java with C/C++ 60 calling C code from Java 60 More on Makefiles 65 Compiling native code from Eclipse 67 creating a hybrid Java/C/C++ project 67 Summary 72 Chapter 3: Interfacing Java and C/C++ with JNI 73 Working with Java primitives 74 a native key/value store 75 Referencing Java objects from native code 85 saving a reference to an object in the Store 85 Local and global JNI references 90 Throwing exceptions from native code 91 raising exceptions from the Store 92 JNI in C++ 96 Handling Java arrays 96 saving a reference to an object in the Store 97 Checking JNI exceptions 106 Summary 107 Chapter 4: Calling Java Back from Native Code 109 Synchronizing Java and native threads 110 a background thread 111 Attaching and detaching threads 120 More on Java and native code lifecycles 121 Calling Java back from native code 122 Java code from a native thread 122 More on callbacks 133 JNI method definitions 134 Processing bitmaps natively 135 decoding camera feed from native code 136 Summary 146 Chapter 5: Writing a Fullynative Application 147 Creating a native activity 148 a basic native activity 148

initializing creating handling handling Handling activity events 155 handling activity events 155 More on Native App Glue 166 Ul thread 167 Native thread 168 Android_app structure 170 Accessing window and time natively 171 displaying raw graphics and implementing a timer 172 More on time primitives 181 Summary 181 Chapter 6: Rendering Graphics with OpenGL ES Initializing OpenGL ES 184 lg3 OpenGL ES 184 Reading PNG textures with the asset manager 193 loading a texture in OpenGL ES 194 Drawing a sprite 208 drawing a Ship sprite 209 Rendering a tile map with vertex buffer objects 220 drawing a tilebased background 221 Summary 238 Chapter 7: Playing Sound with OpenSL ES 239 Initializing OpenSL ES 241 OpenSL ES engine and output 241 More on OpenSL ES philosophy 248 Playing music files 249 playing background music 249 Playing sounds 256 creating and playing a sound buffer queue 257 Event callback 266 Recording sounds 268 Summary 272 Chapter 8: Handling Input Devices and Sensors 273 Interacting with Android 274 touch events 276 Detecting keyboard, DPad, and Trackball events 288 keyboard, DPad, and trackball, natively 289 Probing device sensors 298 turning your device into a joypad 300 Summary 313

analysing Chapter 9: Porting Existing Libraries to Android 315 Developing with the Standard Template Library 316 embedding GNU STL in DroidBlaster 316 Static versus shared 326 STL performances 327 Compiling Boost on Android 328 embedding Boost in DroidBlaster 328 Porting thirdparty libraries to Android 338 compiling Box2D and Irrlicht with the NDK 339 GCC optimization levels 346 Mastering Makefiles 346 Makefile variables 347 Makefile Instructions 348 Summary 351 Chapter 10: Towards Professional Gaming 353 Simulating physics with Box2D 353 simulating physics with Box2D 354 More on collision detection 366 Collision modes 367 Collision filtering 368 More resources about Box2D 369 Running a 3D engine on Android 369 rendring 3D graphics with Irrlicht 370 More on Irrlicht scene management 381 Summary 382 Chapter 11: Debugging and Troubleshooting 383 Debugging with GDB 383 debugging DroidBlaster 384 Stack trace analysis 392 a crash dump 392 More on crash dumps 396 Performance analysis 397 running GProf 398 How it works 403 ARM, thumb, and NEON 403 Summary 405 Index 411