万本电子书0元读

万本电子书0元读

顶部广告

Android NDK: Beginner's Guide - Second Edition电子书

售       价:¥

27人正在读 | 0人评论 6.2

作       者:Sylvain Ratabouil

出  版  社:Packt Publishing

出版时间:2015-04-28

字       数:179.6万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Are you an Android Java programmer who needs more performanceAre you a C/C++ developer who doesn’t want to bother with the complexity of Java and its out-of-control garbage collectorDo you want to create fast intensive multimedia applications or gamesIf you’ve answered yes to any of these questions then this book is for you. With some general knowledge of C/C++ development, you will be able to dive headfirst into native Android development.
目录展开

Android NDK Beginner's Guide Second Edition

Table of Contents

Android NDK Beginner's Guide Second Edition

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Sections

Time for action – heading

What just happened?

Have a go hero – heading

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Setting Up Your Environment

Getting started with Android development

Setting up Windows

Time for action – preparing Windows for Android development

What just happened?

Installing Android development kits on Windows

Time for action – installing Android SDK and NDK on Windows

What just happened?

Setting up OS X

Time for action – preparing OS X for Android development

What just happened?

Installing Android development kits on OS X

Time for action – installing Android SDK and NDK on OS X

What just happened?

Setting up Linux

Time for action – preparing Ubuntu for Android development

What just happened?

Installing Android development kits on Linux

Time for action – installing Android SDK and NDK on Ubuntu

What just happened?

Installing the Eclipse IDE

Time for action – installing Eclipse with ADT on your OS

What just happened?

Setting up the Android emulator

Time for action – creating an Android virtual device

What just happened?

Developing with an Android device

Time for action – setting up an Android device

What just happened?

More about ADB

Summary

2. Starting a Native Android Project

Building NDK sample applications

Time for action – compiling and deploying San Angeles sample

What just happened?

Generating project files with Android manager

Compiling native code with NDK-Build

Building and packaging an application with Ant

Deploying an application package with Ant

Launching an application with ADB Shell

More about Android tooling

Creating your first native Android project

Time for action – creating a native Android project

What just happened?

Introducing Dalvik and ART

Interfacing Java with C/C++

Time for action – calling C code from Java

What just happened?

Debugging native Android applications

Time for action – debugging a native Android application

What just happened?

Defining NDK application-wide settings

NDK-GDB day-to-day

Analyzing native crash dumps

Time for action – analyzing a native crash dump

What just happened?

Deciphering crash dumps

Setting up a Gradle project to compile native code

Time for action – creating a native Android project

What just happened?

Time for action – using your own Makefiles with Gradle

What just happened?

Summary

3. Interfacing Java and C/C++ with JNI

Initializing a native JNI library

Time for action – defining a simple GUI

What just happened?

Time for action – initializing the native store

What just happened?

Converting Java strings in native code

Time for action – handling strings in the native store

What just happened?

Native character encoding

JNI String API

Passing Java primitives to native code

Time for action – handling primitives in the native store

What just happened?

Have a go hero – passing and returning other primitive types

Referencing Java objects from native code

Time for action – saving references to Objects in native Store

What just happened?

Local references

Global references

Weak references

Managing Java arrays

Time for action – handling Java arrays in native Store

What just happened?

Primitive arrays

Have a go hero – handling other array types

Object arrays

Raising and checking Java exceptions

Time for action – raising & catching exceptions in native Store

What just happened?

Executing code in Exception state

Exception handling API

Summary

4. Calling Java Back from Native Code

Calling Java back from native code

Time for action – determining JNI method signatures

What just happened?

Time for action – calling back Java from native code

What just happened?

More on the JNI Reflection API

Debugging JNI

Synchronizing Java and native threads

Time for action – allocating an object with JNI

What just happened?

Time for action – running and synchronizing a thread

What just happened?

Synchronizing Java and C/C++ with JNI Monitors

Attaching and detaching native threads

Processing bitmaps natively

Time for action – decoding a camera's feed

What just happened?

Time for action – processing pictures with the Bitmap API

What just happened?

Registering native methods manually

JNI in C versus JNI in C++

Summary

5. Writing a Fully Native Application

Creating a native Activity

Time for action – creating a basic native Activity

What just happened?

More about the Native App Glue

Handling Activity events

Time for action – stepping the event loop

What just happened?

Time for action – handling Activity events

What just happened?

Accessing window surface natively

Time for action – displaying raw graphics

What just happened?

Measuring time natively

Time for action – animating graphics with a timer

What just happened?

Summary

6. Rendering Graphics with OpenGL ES

Initializing OpenGL ES

Time for action – initializing OpenGL ES

What just happened?

Time for action – clearing and swapping buffers

What just happened?

An insight into the OpenGL pipeline

Loading textures using the Asset manager

Time for action – reading assets with the Asset manager

What just happened?

More about the Asset Manager API

Time for action – compiling and embedding libpng module

What just happened?

Time for action – loading a PNG image

What just happened?

Time for action – generating an OpenGL texture

What just happened?

More about textures

Drawing 2D sprites

Time for action – initializing OpenGL ES

What just happened?

Vertex Arrays versus Vertex Buffer Object

Rendering particle effects

Time for action – rendering a star field

What just happened?

Programming shaders with GLSL

Adapting graphics to various resolutions

Time for action – adapting resolution with off-screen rendering

What just happened?

Summary

7. Playing Sound with OpenSL ES

Initializing OpenSL ES

Time for action – creating OpenSL ES engine and output

What just happened?

More on OpenSL ES philosophy

Playing music files

Time for action – playing background music

What just happened?

Playing sounds

Time for action – creating and playing a sound buffer queue

What just happened?

Using callbacks to detect sound queue events

Low latency on Android

Recording sounds

Have a go hero – recording and playing a sound

Creating and releasing the recorder

Recording a sound

Recording a callback

Summary

8. Handling Input Devices and Sensors

Interacting with touch events

Time for action – handling touch events

What just happened?

Detecting keyboard, D-Pad, and Trackball events

Time for action – handling keyboard, D-Pad, and trackball events natively

What just happened?

Probing device sensors

Time for action – handling accelerometer events

What just happened?

Time for action – turning an Android device into a Joypad

What just happened?

More on sensors

Summary

9. Porting Existing Libraries to Android

Activating the Standard Template Library

Time for action – activating GNU STL in DroidBlaster

What just happened?

Time for action – read files with STL stream

What just happened?

Time for action – using STL containers

What just happened?

Porting Box2D to Android

Time for action – compiling Box2D on Android

What just happened?

Time for action – running Box2D physics engine

What just happened?

Diving into the Box2D world

More on collision detection

Collision modes and filtering

Going further with Box2D

Prebuilding Boost on Android

Time for action – prebuilding Boost static library

What just happened?

Time for action – compiling an executable linked to Boost

What just happened?

Mastering module Makefiles

Makefile variables

Enabling C++ 11 support and the Clang compiler

Makefile Instructions

Have a go hero – mastering Makefiles

CPU Architectures (ABI)

Advanced instruction sets (NEON, VFP, SSE, MSA)

Summary

10. Intensive Computing with RenderScript

What is RenderScript ?

Executing a predefined Intrinsic

Time for action – creating a Java UI

Time for action – running RenderScript Blur intrinsic

What just happened?

Writing a custom Kernel

Time for action – writing a luminance threshold filter

What just happened?

Combining scripts together

Time for action – combining Intrinsics and scripts together

What just happened?

Summary

11. Afterword

Where we have been

Where you can go

Where to find help

This is just the beginning

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部