SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
Native Android
for
Windows Developers

Yossi Cohen
INSTALLATIONS

Install Eclipse + CDT
Install SDK
Install ADT
Install USB Driver
Install NDK
Install Cygwin ….
Eclipse Installation
• Download & Install Eclipse
  ▫ Select the classic version from
    http://www.eclipse.org/downloads/
  ▫ CDT for C/C++ development is recommended
       Select “Install New Software” from Eclipse’ Help menu
      Select available software sites
      Check CDT
      Install CDT components
SDK Installation
• Download & Install SDK (select windows option)
  ▫ http://developer.android.com/sdk/index.html
• Install the ADT (Android Developer Tools) for Eclipse
  ▫ Instructions:
  ▫ http://developer.android.com/sdk/eclipse-adt.html#installing
  ▫ Press Add in available software menu




  ▫ Add ADT with the link below



                                                                   4
USB Driver / NDK Installations
• Install USB Driver
 ▫ If you don’t have a nexus phone download driver
   from vendor. Instructions:
   http://developer.android.com/sdk/oem-usb.html#InstallingDriver
• Install NDK
 ▫ http://developer.android.com/sdk/ndk/index.html

• Preferably do all Installations in D:Android




                                                                    5
Cygwin Installation
•   Goo to http://cygwin.com/ and download setup
•   Install Cygwin.
•   Select default install options
•   After installation, add the following Dirs to
    Cygwin Path:
    ▫ C:Androidandroid-sdktools
    ▫ C:Androidandroid-ndk-r7buildtools




                                                    6
THE FIRST NDK SAMPLE
Running a native sample app
• In Eclipse, Select:
  ▫ File->New->Project->Android
    Project
• Select “Create Project From
  Existing Source”
• change the directory to the
  Installed NDK samples:
• D:Androidandroid-ndk-
  r7samplesHello-Jni
• Select target and finish
Compile & Run
• Compile the Java application
• Run it on your phone target
• Crash?
• Open Cygwin window
• Compile the native code in:
  D:Androidandroid-ndk-r7samplesHello-Jni
  JNI using ndk-build command
• Compile the Java application
• Run it on your target



                                                 9
CODE REVIEW




              10
Java Code Review
• Java part of the application is simple:




• On create, the application prints to the screen a
  string it receives from stringFromJNI() declared
  as a Native function
• Native library hello-jni is loaded
                                                      11
Java to C calling convention
/* sample method where the Java call passed no parameters */
void Java_ClassName_MethodName (JNIEnv *env, jobject obj)
{/* do something */ }
/* another sample method with two parameters passed, returning
a double */
jdouble Java_ClassName_MethodName ( JNIEnv* env, jobject obj,
   jdouble x, jdouble y)
{ return x + y; }
• Note: Android Java identifies the native functions according to their
   C type signature. If the call is for CPP functions, the Java program
   will not recognize them. The solution to this problem is to use
   extern “C” { } around the CPP functions
Make Files
• Android native applications must could have two
  make files:
 ▫ Android.mk – details the source header and
   libraries used to create the application (library)
 ▫ Application.mk – details the target platform,
   processor (ARM 7) and API level (API 10). The
   application.mk file is not mandatory
Android.mk Sample
Example, the HelloJNI NDK sample make File

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := hello-jni
LOCAL_SRC_FILES := hello-jni.c

include $(BUILD_SHARED_LIBRARY)
Android.mk Review
• LOCAL_PATH := $(call my-dir)
 ▫ first understand where we are since include paths
   are usually RELATIVE to our current location.
   This must be the first command in the mk file
• CLEAR_VARS - clears special GNU Makefile
  LOCAL_XXX variables like LOCAL_SRC_FILES
• LOCAL_MODULE := hello-jni
  The LOCAL_MODULE variable must be defined
  to identify each module you describe in your
  Android.mk. The name must be *unique*
  without spaces.
Application.mk Review
• The hello-jni sample does not include
  application.mk file.
• Application.mk can define the target platform as
  9 (Android 2.2)                APP_PLATFORM := android-9


• Application file can also define the processor
  version:
# Build both ARMv5TE and ARMv7-A machine code.
APP_ABI := armeabi armeabi-v7a
Refrences
• Review of Android Make file
• Native android development
• Cygwin Install for Android
DSP-IP Contact information
For courses & programming services contact

Yossi Cohen
yossi@dsp-ip.com
+972-545-313092

Weitere ähnliche Inhalte

Was ist angesagt?

Code in the cloud with Eclipse Che and Docker
Code in the cloud with Eclipse Che and DockerCode in the cloud with Eclipse Che and Docker
Code in the cloud with Eclipse Che and DockerFlorent BENOIT
 
Continuos integration for iOS projects
Continuos integration for iOS projectsContinuos integration for iOS projects
Continuos integration for iOS projectsAleksandra Gavrilovska
 
Accessors Vs Direct access to properties & Design Pattern
Accessors Vs Direct access to properties & Design PatternAccessors Vs Direct access to properties & Design Pattern
Accessors Vs Direct access to properties & Design PatternCocoaHeads France
 
2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudsonShreeniwas Iyer
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017Takayoshi Tanaka
 
Deployment Automation with Docker
Deployment Automation with DockerDeployment Automation with Docker
Deployment Automation with DockerEgor Pushkin
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具謝 宗穎
 
Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017stevanLM
 
CI/CD with Docker on AWS
CI/CD with Docker on AWSCI/CD with Docker on AWS
CI/CD with Docker on AWSHart Hoover
 
Eclipse Neon Webinar - Docker Tooling for Developers
Eclipse Neon Webinar - Docker Tooling for DevelopersEclipse Neon Webinar - Docker Tooling for Developers
Eclipse Neon Webinar - Docker Tooling for DevelopersXavier Coulon
 
Extending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEsExtending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEsFlorent BENOIT
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flowAndrii Podanenko
 
Docker Tooling for Java EE Developers
Docker Tooling for Java EE  DevelopersDocker Tooling for Java EE  Developers
Docker Tooling for Java EE DevelopersXavier Coulon
 
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The PipelineDOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The PipelinePROIDEA
 
Docker SQL Continuous Integration Flow
Docker SQL Continuous Integration FlowDocker SQL Continuous Integration Flow
Docker SQL Continuous Integration FlowAndrii Podanenko
 
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonEclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonVladLica
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandTroublemaker Khunpech
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage buildAlexei Ledenev
 
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group MeetupOpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group MeetupTobias Schneck
 
OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!Tobias Schneck
 

Was ist angesagt? (20)

Code in the cloud with Eclipse Che and Docker
Code in the cloud with Eclipse Che and DockerCode in the cloud with Eclipse Che and Docker
Code in the cloud with Eclipse Che and Docker
 
Continuos integration for iOS projects
Continuos integration for iOS projectsContinuos integration for iOS projects
Continuos integration for iOS projects
 
Accessors Vs Direct access to properties & Design Pattern
Accessors Vs Direct access to properties & Design PatternAccessors Vs Direct access to properties & Design Pattern
Accessors Vs Direct access to properties & Design Pattern
 
2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson
 
20170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 201720170321 docker with Visual Studio 2017
20170321 docker with Visual Studio 2017
 
Deployment Automation with Docker
Deployment Automation with DockerDeployment Automation with Docker
Deployment Automation with Docker
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
 
Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017
 
CI/CD with Docker on AWS
CI/CD with Docker on AWSCI/CD with Docker on AWS
CI/CD with Docker on AWS
 
Eclipse Neon Webinar - Docker Tooling for Developers
Eclipse Neon Webinar - Docker Tooling for DevelopersEclipse Neon Webinar - Docker Tooling for Developers
Eclipse Neon Webinar - Docker Tooling for Developers
 
Extending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEsExtending Eclipse Che to build custom cloud IDEs
Extending Eclipse Che to build custom cloud IDEs
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flow
 
Docker Tooling for Java EE Developers
Docker Tooling for Java EE  DevelopersDocker Tooling for Java EE  Developers
Docker Tooling for Java EE Developers
 
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The PipelineDOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
 
Docker SQL Continuous Integration Flow
Docker SQL Continuous Integration FlowDocker SQL Continuous Integration Flow
Docker SQL Continuous Integration Flow
 
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonEclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Docker multi-stage build
Docker multi-stage buildDocker multi-stage build
Docker multi-stage build
 
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group MeetupOpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
 
OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!
 

Ähnlich wie Native Android for Windows Developers

Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - IntroductionRakesh Jha
 
Native development kit (ndk) introduction
Native development kit (ndk)  introductionNative development kit (ndk)  introduction
Native development kit (ndk) introductionRakesh Jha
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Rhodes mobile Framework
Rhodes mobile FrameworkRhodes mobile Framework
Rhodes mobile FrameworkYoshi Sakai
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Paris Android User Group
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDKKirill Kounik
 
DLL Design with Building Blocks
DLL Design with Building BlocksDLL Design with Building Blocks
DLL Design with Building BlocksMax Kleiner
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)DroidConTLV
 
Mobile app with cordova
Mobile app with cordovaMobile app with cordova
Mobile app with cordovaCandice Zhuang
 
[CCDD2013w] Coming to grips with deving for android by 蔡亦恒
[CCDD2013w] Coming to grips with deving for android by 蔡亦恒[CCDD2013w] Coming to grips with deving for android by 蔡亦恒
[CCDD2013w] Coming to grips with deving for android by 蔡亦恒CCDD_DDLab
 
Video optimization for android - Part I
Video optimization for android - Part IVideo optimization for android - Part I
Video optimization for android - Part IYoss Cohen
 
Introduction of phonegap installation and configuration of Phonegap with An...
Introduction of phonegap   installation and configuration of Phonegap with An...Introduction of phonegap   installation and configuration of Phonegap with An...
Introduction of phonegap installation and configuration of Phonegap with An...Rakesh Jha
 
React native on windows
React native on windowsReact native on windows
React native on windowsAbdul Karim
 

Ähnlich wie Native Android for Windows Developers (20)

Android ndk
Android ndkAndroid ndk
Android ndk
 
Android NDK
Android NDKAndroid NDK
Android NDK
 
Android ndk - Introduction
Android ndk  - IntroductionAndroid ndk  - Introduction
Android ndk - Introduction
 
Native development kit (ndk) introduction
Native development kit (ndk)  introductionNative development kit (ndk)  introduction
Native development kit (ndk) introduction
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Rhodes mobile Framework
Rhodes mobile FrameworkRhodes mobile Framework
Rhodes mobile Framework
 
Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014Using the android ndk - DroidCon Paris 2014
Using the android ndk - DroidCon Paris 2014
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
 
NDK Introduction
NDK IntroductionNDK Introduction
NDK Introduction
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
Android app upload
Android app uploadAndroid app upload
Android app upload
 
DLL Design with Building Blocks
DLL Design with Building BlocksDLL Design with Building Blocks
DLL Design with Building Blocks
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Mobile app with cordova
Mobile app with cordovaMobile app with cordova
Mobile app with cordova
 
Mobile app with cordova
Mobile app with cordovaMobile app with cordova
Mobile app with cordova
 
[CCDD2013w] Coming to grips with deving for android by 蔡亦恒
[CCDD2013w] Coming to grips with deving for android by 蔡亦恒[CCDD2013w] Coming to grips with deving for android by 蔡亦恒
[CCDD2013w] Coming to grips with deving for android by 蔡亦恒
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
Video optimization for android - Part I
Video optimization for android - Part IVideo optimization for android - Part I
Video optimization for android - Part I
 
Introduction of phonegap installation and configuration of Phonegap with An...
Introduction of phonegap   installation and configuration of Phonegap with An...Introduction of phonegap   installation and configuration of Phonegap with An...
Introduction of phonegap installation and configuration of Phonegap with An...
 
React native on windows
React native on windowsReact native on windows
React native on windows
 

Mehr von Yoss Cohen

Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
open platform for swarm training
open platform for swarm training open platform for swarm training
open platform for swarm training Yoss Cohen
 
Deep Learning - system view
Deep Learning - system viewDeep Learning - system view
Deep Learning - system viewYoss Cohen
 
Dspip deep learning syllabus
Dspip deep learning syllabusDspip deep learning syllabus
Dspip deep learning syllabusYoss Cohen
 
IoT consideration selection
IoT consideration selectionIoT consideration selection
IoT consideration selectionYoss Cohen
 
Nvidia jetson nano bringup
Nvidia jetson nano bringupNvidia jetson nano bringup
Nvidia jetson nano bringupYoss Cohen
 
Autonomous car teleportation architecture
Autonomous car teleportation architectureAutonomous car teleportation architecture
Autonomous car teleportation architectureYoss Cohen
 
Motion estimation overview
Motion estimation overviewMotion estimation overview
Motion estimation overviewYoss Cohen
 
Computer Vision - Image Filters
Computer Vision - Image FiltersComputer Vision - Image Filters
Computer Vision - Image FiltersYoss Cohen
 
Intro to machine learning with scikit learn
Intro to machine learning with scikit learnIntro to machine learning with scikit learn
Intro to machine learning with scikit learnYoss Cohen
 
DASH and HTTP2.0
DASH and HTTP2.0DASH and HTTP2.0
DASH and HTTP2.0Yoss Cohen
 
HEVC Definitions and high-level syntax
HEVC Definitions and high-level syntaxHEVC Definitions and high-level syntax
HEVC Definitions and high-level syntaxYoss Cohen
 
Introduction to HEVC
Introduction to HEVCIntroduction to HEVC
Introduction to HEVCYoss Cohen
 
FFMPEG on android
FFMPEG on androidFFMPEG on android
FFMPEG on androidYoss Cohen
 
Hands-on Video Course - "RAW Video"
Hands-on Video Course - "RAW Video" Hands-on Video Course - "RAW Video"
Hands-on Video Course - "RAW Video" Yoss Cohen
 
Video quality testing
Video quality testingVideo quality testing
Video quality testingYoss Cohen
 
HEVC / H265 Hands-On course
HEVC / H265 Hands-On courseHEVC / H265 Hands-On course
HEVC / H265 Hands-On courseYoss Cohen
 
Web video standards
Web video standardsWeb video standards
Web video standardsYoss Cohen
 
Product wise computer vision development
Product wise computer vision developmentProduct wise computer vision development
Product wise computer vision developmentYoss Cohen
 

Mehr von Yoss Cohen (20)

Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
open platform for swarm training
open platform for swarm training open platform for swarm training
open platform for swarm training
 
Deep Learning - system view
Deep Learning - system viewDeep Learning - system view
Deep Learning - system view
 
Dspip deep learning syllabus
Dspip deep learning syllabusDspip deep learning syllabus
Dspip deep learning syllabus
 
IoT consideration selection
IoT consideration selectionIoT consideration selection
IoT consideration selection
 
IoT evolution
IoT evolutionIoT evolution
IoT evolution
 
Nvidia jetson nano bringup
Nvidia jetson nano bringupNvidia jetson nano bringup
Nvidia jetson nano bringup
 
Autonomous car teleportation architecture
Autonomous car teleportation architectureAutonomous car teleportation architecture
Autonomous car teleportation architecture
 
Motion estimation overview
Motion estimation overviewMotion estimation overview
Motion estimation overview
 
Computer Vision - Image Filters
Computer Vision - Image FiltersComputer Vision - Image Filters
Computer Vision - Image Filters
 
Intro to machine learning with scikit learn
Intro to machine learning with scikit learnIntro to machine learning with scikit learn
Intro to machine learning with scikit learn
 
DASH and HTTP2.0
DASH and HTTP2.0DASH and HTTP2.0
DASH and HTTP2.0
 
HEVC Definitions and high-level syntax
HEVC Definitions and high-level syntaxHEVC Definitions and high-level syntax
HEVC Definitions and high-level syntax
 
Introduction to HEVC
Introduction to HEVCIntroduction to HEVC
Introduction to HEVC
 
FFMPEG on android
FFMPEG on androidFFMPEG on android
FFMPEG on android
 
Hands-on Video Course - "RAW Video"
Hands-on Video Course - "RAW Video" Hands-on Video Course - "RAW Video"
Hands-on Video Course - "RAW Video"
 
Video quality testing
Video quality testingVideo quality testing
Video quality testing
 
HEVC / H265 Hands-On course
HEVC / H265 Hands-On courseHEVC / H265 Hands-On course
HEVC / H265 Hands-On course
 
Web video standards
Web video standardsWeb video standards
Web video standards
 
Product wise computer vision development
Product wise computer vision developmentProduct wise computer vision development
Product wise computer vision development
 

Kürzlich hochgeladen

Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 

Kürzlich hochgeladen (20)

Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 

Native Android for Windows Developers

  • 2. INSTALLATIONS Install Eclipse + CDT Install SDK Install ADT Install USB Driver Install NDK Install Cygwin ….
  • 3. Eclipse Installation • Download & Install Eclipse ▫ Select the classic version from http://www.eclipse.org/downloads/ ▫ CDT for C/C++ development is recommended  Select “Install New Software” from Eclipse’ Help menu  Select available software sites  Check CDT  Install CDT components
  • 4. SDK Installation • Download & Install SDK (select windows option) ▫ http://developer.android.com/sdk/index.html • Install the ADT (Android Developer Tools) for Eclipse ▫ Instructions: ▫ http://developer.android.com/sdk/eclipse-adt.html#installing ▫ Press Add in available software menu ▫ Add ADT with the link below 4
  • 5. USB Driver / NDK Installations • Install USB Driver ▫ If you don’t have a nexus phone download driver from vendor. Instructions: http://developer.android.com/sdk/oem-usb.html#InstallingDriver • Install NDK ▫ http://developer.android.com/sdk/ndk/index.html • Preferably do all Installations in D:Android 5
  • 6. Cygwin Installation • Goo to http://cygwin.com/ and download setup • Install Cygwin. • Select default install options • After installation, add the following Dirs to Cygwin Path: ▫ C:Androidandroid-sdktools ▫ C:Androidandroid-ndk-r7buildtools 6
  • 7. THE FIRST NDK SAMPLE
  • 8. Running a native sample app • In Eclipse, Select: ▫ File->New->Project->Android Project • Select “Create Project From Existing Source” • change the directory to the Installed NDK samples: • D:Androidandroid-ndk- r7samplesHello-Jni • Select target and finish
  • 9. Compile & Run • Compile the Java application • Run it on your phone target • Crash? • Open Cygwin window • Compile the native code in: D:Androidandroid-ndk-r7samplesHello-Jni JNI using ndk-build command • Compile the Java application • Run it on your target 9
  • 11. Java Code Review • Java part of the application is simple: • On create, the application prints to the screen a string it receives from stringFromJNI() declared as a Native function • Native library hello-jni is loaded 11
  • 12. Java to C calling convention /* sample method where the Java call passed no parameters */ void Java_ClassName_MethodName (JNIEnv *env, jobject obj) {/* do something */ } /* another sample method with two parameters passed, returning a double */ jdouble Java_ClassName_MethodName ( JNIEnv* env, jobject obj, jdouble x, jdouble y) { return x + y; } • Note: Android Java identifies the native functions according to their C type signature. If the call is for CPP functions, the Java program will not recognize them. The solution to this problem is to use extern “C” { } around the CPP functions
  • 13. Make Files • Android native applications must could have two make files: ▫ Android.mk – details the source header and libraries used to create the application (library) ▫ Application.mk – details the target platform, processor (ARM 7) and API level (API 10). The application.mk file is not mandatory
  • 14. Android.mk Sample Example, the HelloJNI NDK sample make File LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello-jni LOCAL_SRC_FILES := hello-jni.c include $(BUILD_SHARED_LIBRARY)
  • 15. Android.mk Review • LOCAL_PATH := $(call my-dir) ▫ first understand where we are since include paths are usually RELATIVE to our current location. This must be the first command in the mk file • CLEAR_VARS - clears special GNU Makefile LOCAL_XXX variables like LOCAL_SRC_FILES • LOCAL_MODULE := hello-jni The LOCAL_MODULE variable must be defined to identify each module you describe in your Android.mk. The name must be *unique* without spaces.
  • 16. Application.mk Review • The hello-jni sample does not include application.mk file. • Application.mk can define the target platform as 9 (Android 2.2) APP_PLATFORM := android-9 • Application file can also define the processor version: # Build both ARMv5TE and ARMv7-A machine code. APP_ABI := armeabi armeabi-v7a
  • 17. Refrences • Review of Android Make file • Native android development • Cygwin Install for Android
  • 18. DSP-IP Contact information For courses & programming services contact Yossi Cohen yossi@dsp-ip.com +972-545-313092