Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document the way to use gendex and dex.go for new GoNativeActivity.java behaviour #5387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cmd/fyne/internal/mobile/gendex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# gendex

## How to run

From project root:

```console
cd ../../../../cmd/fyne/internal/mobile/
go run ./gendex
cd ../../../../
go install ./cmd/fyne
```

It will generate the `./cmd/fyne/internal/mobile/dex.go` file
that will be used in the `fyne` CLI for your next builds.
5 changes: 5 additions & 0 deletions internal/driver/mobile/app/GoNativeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;

// GoNativeActivity is the java implementation that helps Go map to android via the NDK.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this first sentence is right - the activity is the entry point for our Android boot loader.
The NDK connects to this via C - so it's not really providing any connections itself I don't think?...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant (from my VERY limited understanding) is that it was the java SDK object that was a utility for Go to access via the C and the NDK.
I guess I don't know how to express it correctly :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go accesses the Java object via NDK. The Java provides us certain functionality which is accessed through JNI and C functionality.
Is that clearer?

// If you modify this, you need to regenerate the `dex.go` file with the `gendex` util.
// They should be located
// - ./cmd/fyne/internal/mobile/dex.go
// - ./cmd/fyne/internal/mobile/gendex/
public class GoNativeActivity extends NativeActivity {
private static GoNativeActivity goNativeActivity;
private static final int FILE_OPEN_CODE = 1;
Expand Down
Loading