Skip to content

Conversation

@bclarke123
Copy link

Description

Hi, thanks for this fantastic project! I could only find a few code examples to explain how to call Rust directly from Swift / Kotlin, so I added a brief section to the mobile plugin development page. Also, I added an explanation on how to configure Android builds to be compatible with the new 16KB memory alignment requirements. All feedback welcome!

@bclarke123 bclarke123 requested a review from a team as a code owner November 7, 2025 02:53
@github-project-automation github-project-automation bot moved this to 🪵 Backlog in Documentation Nov 7, 2025
@netlify
Copy link

netlify bot commented Nov 7, 2025

Deploy Preview for tauri-v2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6ddc0f3
🔍 Latest deploy log https://app.netlify.com/projects/tauri-v2/deploys/6915d4a529f1470008e6fbe6
😎 Deploy Preview https://deploy-preview-3575--tauri-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (no change from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment on lines 391 to 413
Then in your plugin's Rust code, define the function JNI will look for:

```rust
#[cfg(target_os = "android")]
#[no_mangle]
pub extern "system" fn Java_com_example_HelloWorld_helloWorld(
mut env: JNIEnv,
_class: JClass,
name: JString,
) -> jstring {
log::debug!("Calling JNI Hello World!");
let result = format!("Hello, {}!", name);

match env.new_string(result) {
Ok(jstr) => jstr.into_raw(),
Err(e) => {
log::error!("Failed to create JString: {}", e);
std::ptr::null_mut()
}
}
}
```

Copy link
Contributor

Choose a reason for hiding this comment

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

does Java_com_example_HelloWorld_helloWorld has any correlation with the app name, if so, could you add an aside or note about it. Same about the ios section.

I see patterns but I really don't know if is for illustration or code convention/requirement

thanks

Copy link
Author

Choose a reason for hiding this comment

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

Good note, updated to clarify naming conventions. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🪵 Backlog

Development

Successfully merging this pull request may close these issues.

3 participants