Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Androiddevtools | 7,528 | 13 days ago | 4 | |||||||
收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材等。 | ||||||||||
Matcha | 3,454 | 5 years ago | 3 | November 09, 2017 | 21 | apache-2.0 | Go | |||
Build native mobile apps in Go. | ||||||||||
Rawdrawandroid | 2,246 | 2 months ago | 3 | mit | C | |||||
Build android apps without any java, entirely in C and Make | ||||||||||
Moonlight Android | 2,049 | 14 hours ago | 90 | gpl-3.0 | C | |||||
GameStream client for Android | ||||||||||
Android | 1,172 | 9 days ago | 105 | other | Kotlin | |||||
MEGA Android App | ||||||||||
Deltachat Android | 922 | 15 hours ago | 58 | gpl-3.0 | Java | |||||
Email-based instant messaging for Android. | ||||||||||
Android Vulkan Tutorials | 741 | a month ago | 2 | apache-2.0 | C++ | |||||
A set of samples to illustrate Vulkan API on Android | ||||||||||
Chapter01 | 388 | 4 years ago | 8 | C++ | ||||||
Chapter01 GeekTime ,crash catch sample | ||||||||||
Vulkan Basic Samples | 384 | 2 years ago | 1 | other | C++ | |||||
Drishti | 304 | 4 years ago | 64 | bsd-3-clause | C++ | |||||
Real time eye tracking for embedded and mobile devices. |
Android Studio JNI environment.
Android Studio JNI
Android Studio + NDKJNI
NDKJNI
NDKNative Development Kit
The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++.
NDKCC++
JNIJava Native Interface
APIJavaC&C++Java1.1JNIjavaJava
1.LLDB+NDK
2.NDK
javah
Program$JDKPath$/bin/javah
-encoding UTF-8
Parameters-encoding UTF-8 -d ../jni -jni $FileClass$
Working directory$SourcepathEntry$\..\java
ndk-build so
MAC/Linuxndk-build.cmd
ProgramC:\Develop\Android\sdk\ndk-bundle\ndk-build.cmd
Parameters
Working directory$ModuleFileDir$\src\main
ndk-build clean so
MAC/Linuxndk-build.cmd
ProgramC:\Develop\Android\sdk\ndk-bundle\ndk-build.cmd
Parametersclean
Working directory$ModuleFileDir$\src\main
android.useDeprecatedNdk=true
1.build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
// build:gradlebuild:gradle-experimental
classpath "com.android.tools.build:gradle-experimental:0.7.0"
// classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
//
task clean(type: Delete) {
delete rootProject.buildDir
}
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip//
gradle-experimentalgradle-wrapper
3.app->build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.jeanboy.demo.jnitest"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
}
apply plugin: 'com.android.model.application'//
//apply plugin: 'com.android.application'
model {//
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.jeanboy.demo.jnitest"
minSdkVersion.apiLevel 15
targetSdkVersion.apiLevel 23
versionCode 1
versionName "1.0"
}
ndk {//libnative.so
moduleName "NdkTest"
}
buildTypes {
release {
minifyEnabled false
proguardFiles.add(file("proguard-rules.pro"))//
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
}
4.jni
5.NdkTest.java
public class NdkTest {
static {
System.loadLibrary("NdkTest");//so
}
//native
public static native String getString();
public static native int doAdd(int param1,int param2);
}
NdkTest.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_jeanboy_demo_jnitest_NdkTest */
#ifndef _Included_com_jeanboy_demo_jnitest_NdkTest
#define _Included_com_jeanboy_demo_jnitest_NdkTest
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_jeanboy_demo_jnitest_NdkTest
* Method: getString
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_jeanboy_demo_jnitest_NdkTest_getString
(JNIEnv *, jclass);//native
/*
* Class: com_jeanboy_demo_jnitest_NdkTest
* Method: doAdd
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_com_jeanboy_demo_jnitest_NdkTest_doAdd
(JNIEnv *, jclass, jint, jint);//native
#ifdef __cplusplus
}
#endif
#endif
NdkTest.cpp
#include "com_jeanboy_demo_jnitest_NdkTest.h"
JNIEXPORT jstring JNICALL Java_com_jeanboy_demo_jnitest_NdkTest_getString
(JNIEnv *env, jclass type) {//
return env->NewStringUTF("hello world!!!");
}
/*
* Class: com_jeanboy_demo_jnitest_NdkTest
* Method: doAdd
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_com_jeanboy_demo_jnitest_NdkTest_doAdd
(JNIEnv *env, jclass type, jint param1, jint param2) {//
return param1 + param1;
}
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := NdkTest//moduleName
LOCAL_SRC_FILES := NdkTest.cpp//NdkTest.cpp
include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_MODULES := NdkTest
/*NDKAndroid.mk(makefile)
APP_MODULESAndroid.mkLOCAL_MODULE
NDK*/
APP_ABI := all//armeabi armeabi-v7a x86
AndroidCPU
ARMv5ARMv7 (2010)
x86 (2011)
MIPS (2012)
ARMv8MIPS64x86_64 (2014)
CPUABI
CPU ABI
ARMv5 ---> armeabi
ARMv7 ---> armeabi-v7a
x86 ---> x86
MIPS ---> mips
ARMv8 ---> arm64-v8a
MIPS64 ---> mips64
x86_64 ---> x86_64
armeabiARM* v5TE
ABI
ARM*armeabi
armeabi-v7aARM* v7 FPU
armeabi-v7aarm v7 cpu
mipsMIPSRISCMIPS
(Microprocessor without interlocked piped stages)
x86IA-32 x86armeabi
armeabi-v7aarmeabi
x86soarmeabi
armeabiAndroid
armeabi-v7aarmeabi
x86armeabiarmeabi-v7aAndroid
armeabiarmeabi-v7ax86
so
8.so
9.native
NdkTest.getString();
NdkTest.doAdd(5, 12);
star follow
issue request [email protected]
Copyright 2015 jeanboy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.