Update, qt 5.2 works fine with build-tools r19. Tested with prebuilt qt, both on win8.1 and archlinux. Some old demos do not run. Bad news is the qt 5.2 I compiled from source did not work.
I finally got hellogl_es2 demo to run, after 3 days trying. So far it works on my archlinux. I guess I can make it work on win8.1.
Qt is not that ready for android in my option, at least 5.1. I am not sure about the coming 5.2. There are too many tricks. You need to get right versions of jdk, jre, apache-ant, android-sdk, android-ndk, and so on.
I try to list my settings as detailed as possible.
archlinux 64bit rolling updated.
offical package:
extra/jdk7-openjdk 7.u45_2.4.3-1
extra/jre7-openjdk 7.u45_2.4.3-1
extra/apache-ant 1.9.2-3
aur package:
android-armv7a-eabi-system-image-15 4.0.4_r02-2
android-armv7a-eabi-system-image-19 4.4_r01-1
android-ndk r9b-3
android-platform-10 2.3.3_r02-2
android-platform-11 3.0_r02-2
android-platform-15 4.0.4_r03-1
android-platform-16 4.1.2_r04-1
android-sdk r22.3-1
android-sdk-platform-tools r19-1
android-udev 67-1
(archlinux split sdk into small package, you can also install and manage them through the android-sdk interface)
custom package:
android-qt5 5.1.1-1(I compile qt 5.1.1 for android from source)
android-sdk-build-tools-18.0.1 r18.1.1-1(critical part, latest r19 is not supported by QT5.1. You will have build.xml error with r19)
win 8.1
Make jdk, jre, apache-ant, android-sdk, and ndk up to date.
In the android package managing interface, remove build-tools r19, install r18.1.1.
Double check your system environment variables, ANT_HOME and JAVA_HOME.
If ant works, qt for android should work out of box via qt-creator.
Wednesday, December 11, 2013
Saturday, December 7, 2013
NDK and c++11 and GPL issue
According to "https://vilimpoc.org/blog/2013/10/05/c11-support-on-android-with-g-4-8/", ndk supports c++11 very well with gcc 4.8 and gnustl_static. I also compile my code with clang3.3, it works so far. So I assume clang works as well.
Note that, modern c++11 works only with gnustl. stlport is free, but does not support c++11. At least, my c++11 can not compile without gnustl.
You could set up the environment manually with ndk-build or put them in your Application.mk like this
APP_STL := gnustl_static
APP_ABI := armeabi
NDK_TOOLCHAIN_VERSION := clang
#NDK_TOOLCHAIN_VERSION := 4.8
APP_CPPFLAGS += -std=c++11
There is a little GPL license trick here. gnustl is with GPL. I am to lazy to read the license line by line. So, correct me if I am wrong. To my understanding, you should be fine with static link to gnustl. This means your stuff has not to be GPL via only static linking to gnustl, due to GPLv3 run time exception. However, you would better not use dynamic link to it.
Note that, modern c++11 works only with gnustl. stlport is free, but does not support c++11. At least, my c++11 can not compile without gnustl.
You could set up the environment manually with ndk-build or put them in your Application.mk like this
APP_STL := gnustl_static
APP_ABI := armeabi
NDK_TOOLCHAIN_VERSION := clang
#NDK_TOOLCHAIN_VERSION := 4.8
APP_CPPFLAGS += -std=c++11
There is a little GPL license trick here. gnustl is with GPL. I am to lazy to read the license line by line. So, correct me if I am wrong. To my understanding, you should be fine with static link to gnustl. This means your stuff has not to be GPL via only static linking to gnustl, due to GPLv3 run time exception. However, you would better not use dynamic link to it.
NDK extrenal libs
After googled a lot, I figured out how to include existing prebuilt libs.
You have to add local modules (static or shared), and let your main module to call them in the android.mk.
#Here is the format for static libs. The shared ones work in the similar way.
#I use libpng as an example
include $(CLEAR_VARS)
LOCAL_MODULE := libpng
LOCAL_SRC_FILES := PATH/TO/YOUR/LIB/libpng.a
LOCAL_EXPORT_C_INCLUDES := PATH/TO/YOUR/INCLUDE
include $(PREBUILT_STATIC_LIBRARY)
#call it in your main module
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(ANDROID_TOOLCHAIN)/include/
LOCAL_C_INCLUDES += $(ANDROID_SYSROOT)/include/
LOCAL_MODULE := YourModuleName
LOCAL_CFLAGS := -Wall -Wextra
LOCAL_CPPFLAGS += -std=c++11
LOCAL_SRC_FILES := YourModule.cpp
#add your external static modules
LOCAL_STATIC_LIBRARIES := libpng
LOCAL_LDLIBS := -llog -lGLESv2 -lEGL -landroid
include $(BUILD_SHARED_LIBRARY)
You have to add local modules (static or shared), and let your main module to call them in the android.mk.
#Here is the format for static libs. The shared ones work in the similar way.
#I use libpng as an example
include $(CLEAR_VARS)
LOCAL_MODULE := libpng
LOCAL_SRC_FILES := PATH/TO/YOUR/LIB/libpng.a
LOCAL_EXPORT_C_INCLUDES := PATH/TO/YOUR/INCLUDE
include $(PREBUILT_STATIC_LIBRARY)
#call it in your main module
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(ANDROID_TOOLCHAIN)/include/
LOCAL_C_INCLUDES += $(ANDROID_SYSROOT)/include/
LOCAL_MODULE := YourModuleName
LOCAL_CFLAGS := -Wall -Wextra
LOCAL_CPPFLAGS += -std=c++11
LOCAL_SRC_FILES := YourModule.cpp
#add your external static modules
LOCAL_STATIC_LIBRARIES := libpng
LOCAL_LDLIBS := -llog -lGLESv2 -lEGL -landroid
include $(BUILD_SHARED_LIBRARY)
Tuesday, November 5, 2013
assimp--3.0.1270 clang patch
clang has some different style from gcc. assimp works perfectly with gcc but no luck with clang.
I googled a lot and borrow some patches online. This is tested with linux 64bit clang 3.3 and android ndk clang 3.3
I googled a lot and borrow some patches online. This is tested with linux 64bit clang 3.3 and android ndk clang 3.3
Friday, October 25, 2013
opengl matrix, column major
When I implement lootat function with rotation and translation, I found out the opengl matrix is saved in column major, if you were using 1d array. 2d arrays are with the intuitive representations.
Thursday, October 24, 2013
Simple Makefile to compile and link all the cpp files in the folder
DEFINC := /usr/include/
LIBS := /usr/lib/
INC := $(DEFINC)
CXXFLAGS :=
CXXFLAGS = -I$(INC)
CXXFLAGS += -O2 -march=native
CXXFLAGS += -fPIC
LINK :=
LDFLAGS :=
LDFLAGS += -L$(LIBS) $(LINK)
CXX = g++
LD = g++
SRC := $(wildcard ./*.cpp)
OBJ := $(addprefix ./,$(notdir $(SRC:.cpp=.o)))
TARGET := test
all: $(TARGET)
$(TARGET): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^
obj/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean :
rm -rf ./*.o $(TARGET)
LIBS := /usr/lib/
INC := $(DEFINC)
CXXFLAGS :=
CXXFLAGS = -I$(INC)
CXXFLAGS += -O2 -march=native
CXXFLAGS += -fPIC
LINK :=
LDFLAGS :=
LDFLAGS += -L$(LIBS) $(LINK)
CXX = g++
LD = g++
SRC := $(wildcard ./*.cpp)
OBJ := $(addprefix ./,$(notdir $(SRC:.cpp=.o)))
TARGET := test
all: $(TARGET)
$(TARGET): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^
obj/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean :
rm -rf ./*.o $(TARGET)
Thursday, September 12, 2013
PCM audio
PCM uses signed int to represent sound.U can generate a family of sin function samples, rescale them form -signed_int_max ~ signed_int_max, and convert them into a byte array. Android lib will play it.
Subscribe to:
Posts (Atom)