问题
I'm investigate about Android makefile. Here are the code and Android.mk
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
------------------------------------------------
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
hello.cpp
LOCAL_MODULE:= hello
include $(BUILD_EXECUTABLE)
In command line i run $ndk-build --> generate executable file. It successfully.
Then my project leader ask me about using Android makefile with Java source code. I create Main.java and Android.mk. I replace hello.cpp with Main.java then $ndk-build. But it doesn't work.
Could anyone help me the Android.mk file what command line should i use? --------------------------Other question-------------------------------------
"The Android NDK is a set of tools that allows Android application developers to embed native machine code compiled from C and/or C++ source files into their application packages".
When I use source with .c or .cpp, then run ndk-build to compile executable or library file. As I understand, for java source code, we need other tool SDK/JDK to compile.
But can I use Android makefile to compile Java code, are there any command like jdk-build? Do I need use JNI moethod in Java source code? Because if I generate Java codeonly, then run $ndk-build. it generate output file but there is warning
Android NDK: Unsupported source file extension
来源:https://stackoverflow.com/questions/59385354/can-i-compile-java-code-with-android-makefile