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
// file: android/app/build.gradle | |
... | |
dependencies { | |
... | |
compile project(':react-native-ble-manager') | |
} |
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
import it.innove.BleManagerPackage; // <--- import | |
public class MainApplication extends Application implements ReactApplication { | |
... | |
@Override | |
protected List<ReactPackage> getPackages() { | |
return Arrays.<ReactPackage>asList( | |
new MainReactPackage(), |
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
// file: android/app/build.gradle | |
... | |
dependencies { | |
... | |
compile project(':react-native-ble-manager') | |
} |
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
apply from: "../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" | |
applyNativeModulesSettingsGradle(settings) |
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
$ npx react-native config | |
{ | |
"root": "/Users/bala/sample-app/Sample", | |
"reactNativePath": "/Users/bala/sample-app/Sample/node_modules/react-native", | |
"dependencies": { | |
"react-native-ble-manager": { | |
"root": "/Users/bala/sample-app/Sample/node_modules/react-native-ble-manager", | |
"name": "react-native-ble-manager", | |
"platforms": { | |
"android": { |
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
"android": { | |
"sourceDir": "/Users/bala/sample-app/Sample/node_modules/react-native-ble-manager/android", | |
"folder": "/Users/bala/sample-app/Sample/node_modules/react-native-ble-manager", | |
"packageImportPath": "import it.innove.BleManagerPackage;", | |
"packageInstance": "new BleManagerPackage()" | |
} |
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
import Unsplash, { toJson } from 'unsplash-js'; | |
const unsplashInstance = new Unsplash({ | |
secret: 'Your secret here', | |
accessKey: 'Your accessKey here', | |
}); | |
async function fetchPhotos(keyword, page, limit = 10) { | |
const photoResult = await unsplashInstance.search | |
.photos(keyword, page, limit) |
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
function useUnsplashPhotos(keyword) { | |
const [page, setPage] = useState(1); | |
// default this to true to kick the initial effect hook to | |
// fetch the first page | |
const [shouldFetch, setShouldFetch] = useState(true); | |
const [photos, setPhotos] = useState([]); | |
// return this function for Flatlist to call onEndReached | |
const fetchMore = useCallback(() => setShouldFetch(true), []); |
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
const UnsplashFeed = props => { | |
const [photos, fetchMore] = useUnsplashPhotos('dogs'); | |
const renderItem = ({ item, index }) => { | |
const { uri } = item; | |
return ( | |
<Image | |
source={{ | |
uri, | |
}} |
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
# /usr/local/etc/bash_completion.d | |
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home" | |
export ANDROID_HOME="/Users/bramdoss/Library/Android/sdk" | |
export PATH=$PATH:$ANDROID_HOME/emulator | |
export PATH=$PATH:$ANDROID_HOME/tools | |
export PATH=$PATH:$ANDROID_HOME/tools/bin | |
export PATH=$PATH:$ANDROID_HOME/platform-tools | |
export PATH="$PATH:$JAVA_HOME/bin" |
OlderNewer