GithubHelp home page GithubHelp logo

ndkdemos's Introduction

#ndk on andorid studio for mac ##1.Configure JDK, NDK path environments ####I'm using jdk 1.8.0_45 and official ndk. MacDown Screenshots ##2. Add javah, ndk-build as External Tools (Menu Location is 'Settings > Tools > External Tools') ###2-1. Configure javah MacDown Screenshots ###2-2. Configure ndk-build MacDown Screenshots ###2-3. Configure ndk-build clean MacDown Screenshots ##3. Create a new Android Studio Project ##4. Add a java class for JNI MacDown Screenshots ##5. Create a folder for JNI MacDown Screenshots ##6. Configure build.gradle

android {  
 ...   
 defaultConfig {   
   ...     
   ndk {     
     moduleName "your dllname"    
      }     
   sourceSets.main { 
     jni.srcDirs = []       
     jniLibs.srcDir "src/main/libs"     
        }     
 	...   
 	}  
 ...
}
          

##7. First Build ####We will encounter an error like 'Error: NDK integration is deprecated in the current plugin. blah blah'. ####Because we are not using the experimental class for NDK.

####Let's add one line in 'gradle.properties'.

android.useDeprecatedNdk=true

####And build again, it must be succeeded.

##8. Create a JNI header file ####Use 'NDK external tools - javah' MacDown Screenshots ####Then we will have a JNI header file. MacDown Screenshots ##9. Create a C++ source file

####We don't need to check "Create associated header". MacDown Screenshots

##10. Create some MakeFiles

####Android.mk MacDown Screenshots

####Application.mk MacDown Screenshots

##11. Build Our NDK Library MacDown Screenshots

##12. Let's Use Our NDK Library Function MacDown Screenshots ##13. Final Build and Create APK

ndkdemos's People

Contributors

bsty2015 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.