created react base and updated build to use android sdk 23

This commit is contained in:
Akinwale Ariwodola 2017-12-27 11:28:56 +01:00
parent 4f720ece58
commit a34b20b512
9 changed files with 4578 additions and 22 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.buildozer
app/node_modules/
bin
buildozer.spec
build.log

View file

@ -8,28 +8,31 @@ install:
- export PATH=/usr/bin:$PATH
- sudo dpkg --add-architecture i386
- sudo apt-get -qq update
- sudo apt-get -qq install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
- sudo apt-get -qq install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 npm
- sudo pip install --upgrade cython==0.25.2 pip setuptools
- git clone https://github.com/kivy/buildozer.git
- git clone https://github.com/akinwale/buildozer.git
- cd app
- npm install --save react@16.2.0 react-native
- cd ..
- cd buildozer
- sudo python setup.py install
- cd ..
- mv buildozer.spec.travis buildozer.spec
- mkdir -p cd ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/android-sdk_r21-linux.tgz' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/android-21_r02.zip' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/android-23_r02.zip' -P ~/.buildozer/android/platform/
- wget 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P ~/.buildozer/android/platform/
- unzip -qq ~/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d ~/.buildozer/android/platform/
- tar -xf ~/.buildozer/android/platform/android-sdk_r21-linux.tgz -C ~/.buildozer/android/platform/
- mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-21
- unzip -qq ~/.buildozer/android/platform/android-21_r02.zip -d ~/.buildozer/android/platform/android-sdk-21/platforms
- mv ~/.buildozer/android/platform/android-sdk-21/platforms/android-5.0.1 ~/.buildozer/android/platform/android-sdk-21/platforms/android-21
- mkdir -p ~/.buildozer/android/platform/android-sdk-21/build-tools
- unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d ~/.buildozer/android/platform/android-sdk-21/build-tools
- mv ~/.buildozer/android/platform/android-sdk-21/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-21/build-tools/26.0.1
- mkdir -p ~/.buildozer/android/platform/android-sdk-21/licenses
- echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-21/licenses/android-sdk-license
- tar -xf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/
- mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23
- unzip -qq ~/.buildozer/android/platform/android-23_r02.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms
- mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-6.0.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-23
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools
- unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools
- mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1
- mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses
- echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license
script:
- buildozer android debug | grep -v 'working:' --line-buffered
- cp bin/*.apk /dev/null

25
app/index.js Normal file
View file

@ -0,0 +1,25 @@
import React from 'react';
import {AppRegistry, StyleSheet, Text, View} from 'react-native';
class InfoComponent extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.title}>LBRY Info</Text>
</View>
);
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
title: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
AppRegistry.registerComponent('LBRYApp', () => InfoComponent);

4504
app/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

12
app/package.json Normal file
View file

@ -0,0 +1,12 @@
{
"name": "LBRYApp",
"version": "0.0.1",
"private": "true",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "^16.2.0",
"react-native": "^0.51.0"
}
}

View file

@ -89,13 +89,13 @@ fullscreen = 0
android.permissions = INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
android.api = 21
android.api = 23
# (int) Minimum API required
#android.minapi = 9
android.minapi = 16
# (int) Android SDK version to use
android.sdk = 21
android.sdk = 23
# (str) Android NDK version to use
android.ndk = 13b
@ -139,13 +139,15 @@ android.ndk = 13b
# directory containing the files)
android.add_src = ./src/main/java
android.react_src = ./app
# (list) Android AAR archives to add (currently works only with sdl2_gradle
# bootstrap)
#android.add_aars =
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:appcompat-v7:21.0.3
android.gradle_dependencies = com.android.support:appcompat-v7:23.4.0, com.facebook.react:react-native:+
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable

View file

@ -89,13 +89,13 @@ fullscreen = 0
android.permissions = INTERNET,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
# (int) Android API to use
android.api = 21
android.api = 23
# (int) Minimum API required
#android.minapi = 9
android.minapi = 16
# (int) Android SDK version to use
android.sdk = 21
android.sdk = 23
# (str) Android NDK version to use
android.ndk = 13b
@ -139,13 +139,15 @@ android.ndk = 13b
# directory containing the files)
android.add_src = ./src/main/java
android.react_src = ./app
# (list) Android AAR archives to add (currently works only with sdl2_gradle
# bootstrap)
#android.add_aars =
# (list) Gradle dependencies to add (currently works only with sdl2_gradle
# bootstrap)
android.gradle_dependencies = com.android.support:appcompat-v7:21.0.3
android.gradle_dependencies = com.android.support:appcompat-v7:23.4.0, com.facebook.react:react-native:+
# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable

View file

@ -2,6 +2,7 @@ package org.kivy.android;
import android.app.Service;
import android.os.IBinder;
import android.os.Build;
import android.os.Bundle;
import android.content.Intent;
import android.content.Context;
@ -94,7 +95,9 @@ public class PythonService extends Service implements Runnable {
Intent contextIntent = new Intent(context, PythonActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(context, 0, contextIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(context, serviceTitle, serviceDescription, pIntent);
/*if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
notification.setLatestEventInfo(context, serviceTitle, serviceDescription, pIntent);
}*/
startForeground(1, notification);
}

View file

@ -11,6 +11,10 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/react/node_modules/react-native/android"
}
flatDir {
dirs 'libs'
}