Difference between revisions of "Including SDK Library"

From Neurotech Software Development Kit
Jump to: navigation, search
(XCode)
(Android Studio)
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Android Studio ==
 
== Android Studio ==
 +
 +
===Using jitpack repository===
 +
 +
To get a Git project into your build:
 +
 +
1. Add the JitPack repository to your build file
 +
 +
<source lang=c>
 +
allprojects {
 +
repositories {
 +
...
 +
maven { url 'https://jitpack.io' }
 +
}
 +
}
 +
</source>
 +
 +
2. Add the dependency
 +
 +
<source lang=c>
 +
dependencies {
 +
        compile 'com.github.NeurotechMRC:neuro-sdk:0.6'
 +
}
 +
</source>
 +
 +
You can use the short commit hash or 'anyBranch-SNAPSHOT' as the version
 +
 +
===Build from source===
  
 
== XCode ==
 
== XCode ==
 +
===Include static library===
 
Here described neurosdk library linking for XCode Swift project.
 
Here described neurosdk library linking for XCode Swift project.
  
Line 7: Line 35:
  
 
On your project settings page go to the '''Build Settings''' tab.
 
On your project settings page go to the '''Build Settings''' tab.
[[File:example.jpg|подпись]]
+
 
In '''Search Paths''' section find '''Library Search Paths''' property and set it with path to neurosdk library directory (directory where you downloaded libray to). Then go to '''Swift Compiler General''' section and set path to neurosdk.h file in '''Objective-C Briging''' header. This header contains all interfaces of neurosdk library and should be in '''include''' subdirectory of neurosdk library download path.
+
[[File:Xcode-build-settings-tab.png|center]]
 +
 
 +
 
 +
In '''Search Paths''' section find '''Library Search Paths''' property and set it with path to neurosdk library directory (directory where you downloaded libray to).  
 +
 
 +
[[File:Xcode-library-search-path.png|center]]
 +
 
 +
 
 +
Then go to '''Swift Compiler General''' section and set path to neurosdk.h file in '''Objective-C Briging''' header. This header contains all interfaces of neurosdk library and should be in '''include''' subdirectory of neurosdk library download path.
 +
 
 +
[[File:Xcode-bridging-header-path.png|center]]
 +
 
 +
 
 +
Go to the Build Phases tab and find Link Binary With Libraries section.
 +
 
 +
[[File:Xcode-build-phases-tab.png|center]]
 +
 
 +
 
 +
Click plus button to add needed libs. You need to add Bluetooth framework ('''CoreBluetooth.framework''') and C++ standard library ('''libstdc++.tbd'''), use search to get them. Then add sdk library ('''libneurosdk.a''').
 +
 
 +
[[File:Xcode-link-bin-with-libs.png|center]]
 +
 
 +
 
 +
Click Add Other to find it in download directory.
 +
 
 +
[[File:Xcode-add-other.png|center]]
 +
 +
 
 +
After that you can use SDK in your project.
 +
 
 +
=== Build from sources ===
 +
You can also build neurosdk library from sources in cloned or forked repo.
 +
 
 +
To do this open project neurosdk with XCode from '''ios/libneurosdk''' directory. Select '''libneurosdk''' aggregate target and run project build.
 +
 
 +
[[File:Xcode-libneurosdk-target.png|center]]
 +
 
 +
 
 +
Output files will be in '''ios/libneurosdk/out''' directory.

Latest revision as of 15:22, 21 January 2018

Android Studio

Using jitpack repository

To get a Git project into your build:

1. Add the JitPack repository to your build file

<source lang=c> allprojects { repositories { ... maven { url 'https://jitpack.io' } } } </source>

2. Add the dependency

<source lang=c> dependencies { compile 'com.github.NeurotechMRC:neuro-sdk:0.6' } </source>

You can use the short commit hash or 'anyBranch-SNAPSHOT' as the version

Build from source

XCode

Include static library

Here described neurosdk library linking for XCode Swift project.

Dowload latest library version here

On your project settings page go to the Build Settings tab.

Xcode-build-settings-tab.png


In Search Paths section find Library Search Paths property and set it with path to neurosdk library directory (directory where you downloaded libray to).

Xcode-library-search-path.png


Then go to Swift Compiler General section and set path to neurosdk.h file in Objective-C Briging header. This header contains all interfaces of neurosdk library and should be in include subdirectory of neurosdk library download path.

Xcode-bridging-header-path.png


Go to the Build Phases tab and find Link Binary With Libraries section.

Xcode-build-phases-tab.png


Click plus button to add needed libs. You need to add Bluetooth framework (CoreBluetooth.framework) and C++ standard library (libstdc++.tbd), use search to get them. Then add sdk library (libneurosdk.a).

Xcode-link-bin-with-libs.png


Click Add Other to find it in download directory.

Xcode-add-other.png


After that you can use SDK in your project.

Build from sources

You can also build neurosdk library from sources in cloned or forked repo.

To do this open project neurosdk with XCode from ios/libneurosdk directory. Select libneurosdk aggregate target and run project build.

Xcode-libneurosdk-target.png


Output files will be in ios/libneurosdk/out directory.