Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce an android directory under qt and allow one to package bitcoin-qt for Android by running make apk. Add bitcoin-qt Android build instructions.
- Loading branch information
Showing
16 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ANDROID BUILD NOTES | ||
====================== | ||
|
||
This guide describes how to build and package the `bitcoin-qt` GUI for Android on Linux and macOS. | ||
|
||
## Preparation | ||
|
||
You will need to get the Android NDK and build dependencies for Android as described in [depends/README.md](../depends/README.md). | ||
|
||
## Building and packaging | ||
|
||
After the depends are built configure with one of the resulting prefixes and run `make && make apk` in `src/qt`. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<manifest package="org.bitcoincore.qt" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> | ||
<uses-sdk android:targetSdkVersion="24"/> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<uses-feature android:glEsVersion="0x00020000" android:required="true" /> | ||
|
||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> | ||
|
||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Bitcoin Core"> | ||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" | ||
android:name="org.bitcoincore.qt.BitcoinQtActivity" | ||
android:label="Bitcoin Core" | ||
android:icon="@drawable/bitcoin" | ||
android:screenOrientation="unspecified" | ||
android:launchMode="singleTop"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
|
||
<meta-data android:name="android.app.arguments" android:value="-testnet"/> | ||
<meta-data android:name="android.app.lib_name" android:value="bitcoin-qt"/> | ||
<meta-data android:name="android.app.repository" android:value="default"/> | ||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="1"/> | ||
<meta-data android:name="android.app.use_local_qt_libs" android:value="1"/> | ||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> | ||
<meta-data android:name="android.app.system_libs_prefix" android:value="/system/lib/"/> | ||
<meta-data android:name="android.app.background_running" android:value="true"/> | ||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/> | ||
<meta-data android:name="android.app.extract_android_style" android:value="default"/> | ||
</activity> | ||
|
||
</application> | ||
</manifest> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.2.0' | ||
} | ||
} | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
} | ||
|
||
android { | ||
compileSdkVersion androidCompileSdkVersion.toInteger() | ||
|
||
buildToolsVersion androidBuildToolsVersion | ||
|
||
sourceSets { | ||
main { | ||
manifest.srcFile 'AndroidManifest.xml' | ||
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] | ||
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] | ||
res.srcDirs = [qt5AndroidDir + '/res', 'res'] | ||
resources.srcDirs = ['src'] | ||
renderscript.srcDirs = ['src'] | ||
assets.srcDirs = ['assets'] | ||
jniLibs.srcDirs = ['libs'] | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
|
||
dexOptions { | ||
javaMaxHeapSize '4g' | ||
} | ||
|
||
defaultConfig { | ||
minSdkVersion 24 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
androidBuildToolsVersion=29.0.0-rc3 | ||
androidCompileSdkVersion=24 | ||
qt5AndroidDir=new File(".").absolutePath | ||
org.gradle.jvmargs=-Xmx4608M |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
src/qt/android/src/org/bitcoincore/qt/BitcoinQtActivity.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.bitcoincore.qt; | ||
|
||
import android.os.Bundle; | ||
import android.system.ErrnoException; | ||
import android.system.Os; | ||
|
||
import org.qtproject.qt5.android.bindings.QtActivity; | ||
|
||
import java.io.File; | ||
|
||
public class BitcoinQtActivity extends QtActivity | ||
{ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) | ||
{ | ||
final File bitcoinDir = new File(getFilesDir().getAbsolutePath() + "/.bitcoin"); | ||
if (!bitcoinDir.exists()) { | ||
bitcoinDir.mkdir(); | ||
} | ||
|
||
try { | ||
Os.setenv("QT_QPA_PLATFORM", "android", true); | ||
} catch (ErrnoException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
super.onCreate(savedInstanceState); | ||
} | ||
} |
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