Although it is now the official Android IDE, we are not going to use it much throughout the book because of its lack of support of the NDK. Using the adb shell command on the Ubuntu dev machine. Android Studio is now installed on the system. Confirm the change by clicking OK in the popup window. In Ubuntu Linux, you can use the apt-get command to install Android debugging and testing tool adb. I have get error messages on missing toolchain binary locations, this solved the issues: cd /opt/android-ndk/toolchains/llvm/prebuilt/linux-x8664/bin sudo. The specialty using Ubuntu is just because of Linux Origin. Install Android NDK¶ On the Welcome to Android screen, click Configure and select SDK Manager. Working in OS like Ubuntu and Android Eclipse is much easier than working with MS Windows for NDK. 1 # Change this to whereever you keep NDKĥ DBG ?= 0 6 7 # Debug/Release configurationĨ ifeq ( $( DBG ) ,1) 9 MODE_FLAGS = -DDEBUG -g -O0ġ0 else 11 MODE_FLAGS = -Os -fdata-sections -ffunction-sectionsġ2 endif 13 14 # NDK configuration (clang)ġ7 NDK_TARGETVER = 27 18 19 # Target arch - here aarch64 for androidĢ0 NDK_TARGETARCH = aarch64-linux-androidĢ7 28 # Architecture of a machine that does cross compilationģ2 NDK_TOOLS = $(NDK )/toolchains/llvm/prebuilt/ $(NDK_HOSTARCH )/binģ5 NDK_LIBS = $(NDK )/toolchains/ $(NDK_TARGETARCH )- $(NDK_TOOLVER )/prebuilt/linux-x86_64/lib/gcc/ $(NDK_TARGETARCH )/4.9.xģ6 NDK_INCLUDES = -I $(NDK )/sysroot/usr/include \ģ7 -I $(NDK )/sysroot/usr/include/ $(NDK_TARGETARCH ) 38 NDK_SYSROOT = $(NDK )/platforms/android- $(NDK_TARGETVER )/arch- $(NDK_TARGETSHORTARCH ) 39 40 # Options common to compiler and linkerĤ5 -target $(NDK_TARGETARCH ) 46 47 # Compiler optionsĤ9 $(NDK_INCLUDES ) 50 51 # Linker optionsĥ6 -B $(ANDROID_NDK )/toolchains/ $(NDK_TARGETARCH )- $(NDK_TOOLVER )/prebuilt/linux-x86_64/ $(NDK_TARGETARCH )/bin \ĥ7 -L $(NDK_LIBS ) 58 59 all : 60 $(NDK_TOOL ) -c $(SRCDIR )/main.c -o $(OBJDIR )/main.o $(CFLAGS ) 61 $(NDK_TOOL ) -o main $(OBJDIR )/main.o $(LDFLAGS ) 62 63 adb-prepare : 64 adb rootĬopy this file to same directory as main. If you want to run Android Applications in the Android Emulator, follow the steps below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |