Download Android Native Development Kit Cookbook by Feipeng Liu PDF

By Feipeng Liu

A step by step educational with greater than 60 concise recipes on Android NDK improvement skills.


• construct, debug, and profile Android NDK apps.
• enforce a part of Android apps in local C/C++ code.
• Optimize code functionality in meeting with Android NDK.

In Detail

Building Android functions might often suggest that you just spend your whole time operating in Java. There are even if occasions whilst this isn't the most productive or most sensible procedure for the appliance being outfitted. this can be the place Android NDK comes in.

Android NDK permits the developer to jot down in local C/C++, supplying you with the facility to reuse code and libraries and in addition, typically, bring up the rate and potency of your application.

The Android local improvement package Cookbook may also help you know the advance, development, and debugging of your local Android functions. we are going to observe and research JNI programming and crucial NDK APIs akin to OpenGL ES, and the local program API. we'll then discover the method of porting latest libraries and software program to NDK. by way of the top of this booklet it is possible for you to to construct your individual apps in NDK apps.

Android local improvement package Cookbook starts off with easy recipes to help you within the construction and debugging of local apps, and JNI programming. The recipes hide quite a few themes of program improvement with Android NDK comparable to OpenGL programming and Multimedia programming. we are going to commence with an easy recipe, hi NDK, earlier than relocating directly to conceal complicated issues with recipes on OpenGL ES that target second and 3D images, in addition to recipes that debate operating with NDK and exterior APIs. while you are searching for how one can make your program to be had in Android and take measures to spice up your application’s functionality, then this Cookbook is for you.

What you'll examine from this book

• strengthen Android apps in C/C++ with no unmarried line of Java.
• application 2D/3D pictures with either OpenGL ES 1x and 2.0 in Android NDK.
• Write multi-threaded Android apps in Android NDK.
• Port latest C/C++ libraries and purposes to Android with NDK.
• advance multimedia Android apps with Android NDK.


This e-book is written in a Cookbook type, starting with recipes which concentrate on assisting builders make their software/application on hand in Android.

Who this publication is written for

Android builders who are looking to research Android NDK programming, or increase multimedia and video games in Android NDK will take advantage of this ebook.

Show description

Read Online or Download Android Native Development Kit Cookbook PDF

Similar programming books

Game Programming Gems, Volume 2

Video game Programming gemstones 2, the second one quantity during this profitable sequence, encompasses a thoroughly new set of over 70 articles on assorted subject matters that may be utilized in your individual video game initiatives. Written by way of video game programming specialists, each one contribution offers a hands-on approach to programming difficulties, or an inventive technique for lowering programming time and redundancy.

Functional Programming, Glasgow 1990: Proceedings of the 1990 Glasgow Workshop on Functional Programming 13–15 August 1990, Ullapool, Scotland

This quantity comprises the papers offered on the third Glasgow Workshop on useful Programming which was once held in Ullapool, Scotland, 13-15 August 1990. contributors of the useful programming teams on the universities of Glasgow and Stirling attended the workshop, including a small variety of invited individuals from different universities and undefined.

Programming Languages and Systems: 17th European Symposium on Programming, ESOP 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings

This publication constitutes the refereed complaints of the seventeenth eu Symposium on Programming, ESOP 2008, held in Budapest, Hungary, in March/April 2008, as a part of ETAPS 2008, the eu Joint meetings on thought and perform of software program. The 25 revised complete papers offered including the summary of 1 invited speak and software displays have been conscientiously reviewed and chosen from 104 submissions and deal with primary matters within the specification, research, and implementation of programming languages and sytems.

Additional resources for Android Native Development Kit Cookbook

Example text

Refer to the Loading native libraries and registering native methods recipe of this chapter if you want more detailed instructions. 2. c under the jni folder, then implement the findClassDemo, findClassDemo2, GetSuperclassDemo, and IsAssignableFromDemo methods. We can refer to the downloaded ClassManipulation project source code. 3. java by adding code to load the native library, declare native methods, and invoke native methods. 4. Create a Dummy class and a DummySubClass subclass that extends the Dummy class.

Java programming language uses UTF-16 to represent strings. If a character cannot fit in a 16-bit code value, a pair of code values named surrogate pair is used. C strings are simply an array of bytes terminated by a null character. The actual encoding/decoding is pretty much left to the developer and the underlying system. A modified version of UTF-8 is used by JNI to represent strings, including class, field, and method names in the native code. There are two differences between the modified UTF-8 and standard UTF-8.

The buf argument points to the location to store the converted native UTF-8 char array. Let's compare the two methods. The first method may or may not require allocation of new memory for the converted UTF-8 string depending on whether VM decides to make a new copy or not, whereas the second method made use of a pre-allocated buffer to store the converted content. In addition, the second method allows us to specify the position and length of the conversion source. Therefore, the following rules can be followed: ‰‰ 42 To modify the converted UTF-8 native string, the JNI method GetStringUTFRegion should be used Chapter 2 ‰‰ ‰‰ If we only need a substring of the original Java string, and the substring is not large, the GetStringUTFRegion should be used If we're dealing with a large string, and we're not going to modify the converted UTF-8 native string, GetStringUTFChars should be used In our example, we used a fixed length buffer when calling the GetStringUTFRegion function.

Download PDF sample

Rated 4.31 of 5 – based on 10 votes