Most searched books


New PDF release: Android Native Development Kit Cookbook

By Feipeng Liu

A step by step instructional 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 simply spend your entire time operating in Java. There are besides the fact that occasions while this isn't the best or top procedure for the appliance being outfitted. this can be the place Android NDK comes in.

Android NDK permits the developer to write down in local C/C++, supplying you with the facility to reuse code and libraries and in addition, as a rule, elevate the rate and potency of your application.

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

Android local improvement equipment Cookbook starts with simple recipes that can assist you within the development and debugging of local apps, and JNI programming. The recipes hide quite a few subject matters of software improvement with Android NDK reminiscent of OpenGL programming and Multimedia programming. we'll start with an easy recipe, hi NDK, sooner than relocating directly to disguise complicated subject matters with recipes on OpenGL ES that target second and 3D portraits, in addition to recipes that debate operating with NDK and exterior APIs. when you are searching for how you can make your software to be had in Android and take measures to spice up your application’s functionality, then this Cookbook is for you.

What you are going to research from this book

• enhance Android apps in C/C++ with no unmarried line of Java.
• software 2D/3D pix with either OpenGL ES 1x and 2.0 in Android NDK.
• Write multi-threaded Android apps in Android NDK.
• Port present C/C++ libraries and functions to Android with NDK.
• enhance multimedia Android apps with Android NDK.


This publication is written in a Cookbook sort, starting with recipes which specialize in supporting builders make their software/application on hand in Android.

Who this booklet is written for

Android builders who are looking to study Android NDK programming, or improve multimedia and video games in Android NDK will take advantage of this publication.

Show description

Read or Download Android Native Development Kit Cookbook PDF

Best programming books

Head First jQuery by Ryan Benedetti, Ronan Cranley PDF

Be aware: switched over from azw4

Want so as to add extra interactivity and varnish on your web pages? become aware of how jQuery may help construct advanced scripting performance in exactly a couple of traces of code. With Head First jQuery, you'll quick wake up to hurry in this extraordinary JavaScript library by way of studying the way to navigate HTML records whereas dealing with occasions, results, callbacks, and animations. by the point you've accomplished the ebook, you'll be incorporating Ajax apps, operating seamlessly with HTML and CSS, and dealing with info with Hypertext Preprocessor, MySQL and JSON.

If you need to learn—and understand—how to create interactive websites, unobtrusive script, and funky animations that don't kill your browser, this e-book is for you.

• Use jQuery with DOM to beat the restrictions of HTML and CSS
• learn the way jQuery selectors and activities paintings together
• Write capabilities and cord them to interface elements
• Use jQuery results to create activities at the page
• Make your pages come alive with animation
• construct interactive websites with jQuery and Ajax
• construct types in internet functions

Download e-book for iPad: Generic Programming: International Seminar on Generic by James C. Dehnert, Alexander Stepanov (auth.), Mehdi

This ebook constitutes the completely refereed post-proceedings of the foreign Seminar on accepted Programming held in Dagstuhl fort, Germany in April/May 1998. The 20 revised complete papers have been conscientiously reviewed for inclusion within the e-book. because the first publication solely dedicated to the recent paradigm of general programming, this assortment bargains topical sections on foundations and method comparisons, programming technique, language layout, and purposes.

The Intel Microprocessors: 8086 8088, 80186 80188, 80286, by Barry B. Brey PDF

A text/reference on all programming and interfacing elements of the microprocessor kinfolk, for computing device technological know-how scholars. Early chapters be aware of genuine mode programming, and later chapters comprise info on every one friend and on programming and operation at the numeric coprocessor as we.

Extra resources for Android Native Development Kit Cookbook

Sample text

2. c under the jni folder, then implement the passStringReturnString method as follows: JNIEXPORT jstring JNICALL Java_cookbook_chapter2_ StringManipulationActivity_passStringReturnString(JNIEnv *pEnv, jobject pObj, jstring pStringP){ __android_log_print(ANDROID_LOG_INFO, "native", "print jstring: %s", pStringP); const jbyte *str; jboolean *isCopy; str = (*pEnv)->GetStringUTFChars(pEnv, pStringP, isCopy); __android_log_print(ANDROID_LOG_INFO, "native", "print UTF-8 string: %s, %d", str, isCopy); jsize length = (*pEnv)->GetStringUTFLength(pEnv, pStringP); __android_log_print(ANDROID_LOG_INFO, "native", "UTF-8 string length (number of bytes): %d == %d", length, strlen(str)); __android_log_print(ANDROID_LOG_INFO, "native", "UTF-8 string ends with: %d %d", str[length], str[length+1]); (*pEnv)->ReleaseStringUTFChars(pEnv, pStringP, str); char nativeStr[100]; (*pEnv)->GetStringUTFRegion(pEnv, pStringP, 0, length, nativeStr); __android_log_print(ANDROID_LOG_INFO, "native", "jstring converted to UTF-8 string and copied to native buffer: %s", nativeStr); const char* newStr = "hello 安卓"; jstring ret = (*pEnv)->NewStringUTF(pEnv, newStr); jsize newStrLen = (*pEnv)->GetStringUTFLength(pEnv, ret); __android_log_print(ANDROID_LOG_INFO, "native", "UTF-8 string with Chinese characters: %s, string length (number of bytes) %d=%d", newStr, newStrLen, strlen(newStr)); return ret; } 40 Chapter 2 3.

The native function naGetHelloNDKStr returns the Hello NDK string to the caller, as indicated in both the native code function definition and Java code method declaration. The native function name must follow a specific pattern for a package name, class name, and method name. The package and class name must agree with the package and class name of the Java class from which the native method is called, while the method name must be the same as the method name declared in that Java class. This helps the Dalvik VM to locate the native function at runtime.

6. android. html, and then extract the downloaded file. 7. profile in step 3: export ANDROID_SDK= export ANDROID_NDK= export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platformtools:$ANDROID_NDK 8. Start a new terminal, then go to the samples/hello-jni directory in NDK. Type the command ndk-build. If the build is successful, it proves that the NDK environment is set up correctly. How it works… The steps to set up an Android NDK development environment on Mac OS X are similar to Ubuntu Linux, since both of them are Unix-like operating systems.

Download PDF sample

Rated 4.97 of 5 – based on 12 votes

Comments are closed.