Skip to content

Commit

Permalink
android: enable decoders on android build
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Suciu <[email protected]>
  • Loading branch information
adisuciu committed Nov 4, 2021
1 parent f2a54d6 commit b88dfde
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Makefile
moc_*.cpp
*_automoc.cpp
ui_*.h
build
build*
deps
scopy
android/assets/libsigrokdecode/*
android/assets/python3.*/*
!android/src/org/adi/scopy
*.swp
html/
9 changes: 9 additions & 0 deletions android/assets/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
To have a correct deploy, this should look something like:

assets
- libsigrokdecode
| - decoders
| | - <all the decoders>
- python3.8
| - <python files from staging/lib/python3.8>
- iio-emu (wip)
1 change: 1 addition & 0 deletions android/assets/libsigrokdecode/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Decoders that are copied here will be bundled in the .apk. They can be found in the staging folder/share/libsigrokdecode.
1 change: 1 addition & 0 deletions android/assets/python3.8/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For decoders to work, we need to ship a python environment. You can copy it from stagingfolder/lib/python3.8
18 changes: 9 additions & 9 deletions src/tool_launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1690,17 +1690,17 @@ bool adiscope::ToolLauncher::switchContext(const QString& uri)
info.setText(tr("Digital decoders support is disabled. Some features may be missing"));
info.exec();
} else {
#ifndef __ANDROID__
bool success = loadDecoders("decoders");

if (!success) {
search_timer->stop();
bool success = loadDecoders(":/assets/libsigrokdecode/decoders");

if (!success) {
search_timer->stop();

QMessageBox error(this);
error.setText(tr("There was a problem initializing libsigrokdecode. Some features may be missing"));
error.exec();
}

QMessageBox error(this);
error.setText(tr("There was a problem initializing libsigrokdecode. Some features may be missing"));
error.exec();
}
#endif
}
}

Expand Down

0 comments on commit b88dfde

Please sign in to comment.