Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2480dd3

Browse files
committed
Added sample for jni kotlin
1 parent c6a8356 commit 2480dd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+874
-0
lines changed

‎JniSample/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches/build_file_checksums.ser
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
.DS_Store
9+
/build
10+
/captures
11+
.externalNativeBuild

‎JniSample/.idea/codeStyles/Project.xml

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎JniSample/.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎JniSample/.idea/gradle.xml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎JniSample/.idea/misc.xml

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎JniSample/.idea/runConfigurations.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎JniSample/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎JniSample/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

‎JniSample/app/CMakeLists.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Sets the minimum version of CMake required to build your native library.
2+
# This ensures that a certain set of CMake features is available to
3+
# your build.
4+
5+
cmake_minimum_required(VERSION 3.10.2)
6+
7+
# Specifies a library name, specifies whether the library is STATIC or
8+
# SHARED, and provides relative paths to the source code. You can
9+
# define multiple libraries by adding multiple add_library() commands,
10+
# and CMake builds them for you. When you build your app, Gradle
11+
# automatically packages shared libraries with your APK.
12+
13+
add_library( # Specifies the name of the library.
14+
sample-jni
15+
16+
# Sets the library as a shared library.
17+
SHARED
18+
19+
# Provides a relative path to your source file(s).
20+
src/main/cpp/sample-jni.cpp )
21+
22+
# Searches for a specified prebuilt library and stores the path as a
23+
# variable. Because CMake includes system libraries in the search path by
24+
# default, you only need to specify the name of the public NDK library
25+
# you want to add. CMake verifies that the library exists before
26+
# completing its build.
27+
28+
find_library( # Sets the name of the path variable.
29+
log-lib
30+
31+
# Specifies the name of the NDK library that
32+
# you want CMake to locate.
33+
log )
34+
35+
# Specifies libraries CMake should link to your target library. You
36+
# can link multiple libraries, such as libraries you define in this
37+
# build script, prebuilt third-party libraries, or system libraries.
38+
39+
target_link_libraries( # Specifies the target library.
40+
sample-jni
41+
42+
# Links the target library to the log library
43+
# included in the NDK.
44+
${log-lib} )

‎JniSample/app/build.gradle

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apply plugin: 'com.android.application'
2+
3+
apply plugin: 'kotlin-android'
4+
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
android {
8+
compileSdkVersion 28
9+
defaultConfig {
10+
applicationId "com.pramonow.androidadvanced"
11+
minSdkVersion 19
12+
targetSdkVersion 28
13+
versionCode 1
14+
versionName "1.0"
15+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16+
17+
externalNativeBuild {
18+
cmake {
19+
cppFlags ""
20+
}
21+
}
22+
}
23+
buildTypes {
24+
release {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
externalNativeBuild {
30+
cmake {
31+
path "CMakeLists.txt"
32+
}
33+
}
34+
}
35+
36+
dependencies {
37+
implementation fileTree(dir: 'libs', include: ['*.jar'])
38+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
39+
implementation 'com.android.support:appcompat-v7:28.0.0'
40+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
41+
testImplementation 'junit:junit:4.12'
42+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
43+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
44+
45+
implementation 'com.google.android.gms:play-services-maps:16.0.0'
46+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /