This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run `avdmanager create avd -h` for help | |
avdmanager create avd -n test -k "system-images;android-28;google_apis;x86" -b "x86" -c 512M | |
# start the `test` emulator | |
emulator @test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# redirect your phones port (first argument) with your local computer's port (second argument) | |
adb reverse tcp:8081 tcp:8081 | |
# initiate a bundle reload (specific to react native) | |
adb shell input text RR | |
# opens the device menu (specific to react native by shaking the device) | |
adb shell input keyevent KEYCODE_MENU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reconnect your device/phone connection | |
adb reconnect | |
# show the device log for a specific app / bundle id | |
adb logcat --pid=$(adb shell pidof -s com.mariusreimer.spaceviewer) | |
# copies the file from your machine to the device (may require 'adb root') | |
adb push <local> <remote> | |
# copies the file from the device to your machine (may require 'adb root') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"gitlens.advanced.messages": { | |
"suppressShowKeyBindingsNotice": true | |
}, | |
"explorer.openEditors.visible": 0, | |
"terminal.external.osxExec": "iTerm.app", | |
"terminal.integrated.shell.osx": "/bin/zsh", | |
"workbench.statusBar.feedback.visible": false, | |
"files.autoSave": "onWindowChange", | |
"editor.fontSize": 16, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"key": "cmd+d", | |
"command": "editor.action.copyLinesDownAction", | |
"when": "editorTextFocus && !editorReadonly" | |
}, | |
{ | |
"key": "shift+alt+down", | |
"command": "-editor.action.copyLinesDownAction", | |
"when": "editorTextFocus && !editorReadonly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __cplusplus | |
#import "example.h" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RCT_EXPORT_METHOD( | |
multiply:(nonnull NSNumber*)a | |
withB:(nonnull NSNumber*)b | |
withResolver:(RCTPromiseResolveBlock)resolve | |
withReject:(RCTPromiseRejectBlock)reject | |
) | |
{ | |
long result = example::multiply([a longValue], [b longValue]); | |
resolve(@{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mariusreimer.rncppcode; | |
... | |
class RNCPPCodeModule { | |
static { | |
try { | |
System.loadLibrary("cpp-code"); | |
Log.d(TAG, "-------- libcpp-code: loaded"); | |
} catch (Exception e){ | |
Log.d(TAG, "-------- libcpp-code: loaded"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <jni.h> | |
#include "example.h" | |
extern "C" | |
JNIEXPORT jlong JNICALL | |
Java_com_mariusreimer_rncppcode_RNCPPCodeModule_multiply(JNIEnv *env, jclass type, jlong a, jlong b) { | |
return example::multiply(a, b); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.4.1) | |
set (CMAKE_VERBOSE_MAKEFILE ON) | |
set (CMAKE_CXX_STANDARD 11) | |
add_library(cpp-code | |
SHARED | |
../cpp-code/src/src/example.cpp | |
cpp-adapter.cpp | |
) |