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

Questions regarding this crate #123

Closed
Joe23232 opened this issue Feb 18, 2021 · 19 comments
Closed

Questions regarding this crate #123

Joe23232 opened this issue Feb 18, 2021 · 19 comments
Labels
type: question There's no such thing as a stupid one

Comments

@Joe23232
Copy link

Hi I have some questions regarding this crate:

  1. Am I able to make full blown Android applications by using this crate and the orbtk GUI library crate?
  2. Is it stable or beta/alpha?
  3. Is there a docs page that is similar to the Rust Programming Book?
  4. Is it more difficult to use or easier to use compared to using Android Studio Java?
@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 18, 2021

  1. Ask them 2. It works reliably 3. No 4. Why don't you try both and tell me?

@Joe23232
Copy link
Author

  1. Do I have full API access just like with Android Studio Java app development (minus the GUI support)?

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 18, 2021

You have access to the ndk api, for many things you'll need a good jni library. But my guess would be that if you need to ask these questions, you'll be more happy with Android studio.

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 18, 2021

I mean you could try https://github.com/hecrj/iced, I think it has android support. Unless you want to do opengl/Vulkan rendering yourself that might be your best bet. And if you're interested in how android works, reading the code in this repo might be interesting to you.

@Joe23232
Copy link
Author

Interesting, thanks for the link mate :)

@Joe23232
Copy link
Author

@dvc94ch Hey mate, unfortunately iced does not support Android according to another person I am chatting with :( Just letting you know, do you happen to know other library crates that are easy to use and it supports Android and possibly Windows?

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 19, 2021

Well, I didn't say it would necessarily be easy and I am busy with other stuff, so I really don't have the time to try it out. If you want a ready made solution there is Android studio, which was my first recommendation.

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 19, 2021

Any idea how long it will take you to build your app? If it takes you one year the guy said it would work. If you're done after a month, at least you'll understand how iced works, which is 50% of the puzzle.

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 19, 2021

Apparently I was wrong @cryptoquick built a moderately complex desktop app in rust. I guess that's why I remembered it, as I didn't think that was possible at the time.

@cryptoquick
Copy link

It's likely quite possible, plenty of tools are there, but the work has to be put in to try it and see what works and what doesn't.

See some iOS-related discussion here:
iced-rs/iced#302 (comment)

As for Android, only reason I think cargo mobile hasn't been tried in a similar way is, most people pick one or the other. Someone happened to make Iced work on iOS because they had an iOS device. Time to try with Android!

I'm not a mobile developer, primarily because the thought of publishing on an app store drives me crazy. However, the dream of wanting to build full desktop, web, and mobile compilation targets in a single project seems feasible enough with Rust, Iced, wgpu, and cargo mobile. It's also a worthwhile dream. How much works, and how well, is unclear, however. Will networking or storage APIs work? Who knows. There's definitely plenty to try, at least.

@cryptoquick
Copy link

Also, check this out:
BrainiumLLC/cargo-mobile#4

@Joe23232
Copy link
Author

As for Android, only reason I think cargo mobile hasn't been tried in a similar way is, most people pick one or the other. Someone happened to make Iced work on iOS because they had an iOS device. Time to try with Android!

Sorry just one question, what is the difference between cargo mobile and android-ndk-rs?

So I was looking at another project called fltk-rs and like this also supports Android, however the owner claims that it failed to work with android-ndk-rs and apparently he forgot the reason why, he claims it only works on Android Studio. This particular project seems simpler than Iced.

However, the dream of wanting to build full desktop, web, and mobile compilation targets in a single project seems feasible enough with Rust, Iced, wgpu, and cargo mobile.

So if I wanted to print "Hello World" to the screen then it would be the exact same code, right?

Also, check this out:
BrainiumLLC/cargo-mobile#4

Interesting mate :)

@cryptoquick
Copy link

As for Android, only reason I think cargo mobile hasn't been tried in a similar way is, most people pick one or the other. Someone happened to make Iced work on iOS because they had an iOS device. Time to try with Android!

Sorry just one question, what is the difference between cargo mobile and android-ndk-rs?

I'm not familiar with Android development, but I'm wondering if they reimplemented some of what android-ndk-rs does in here: https://github.com/BrainiumLLC/cargo-mobile/blob/master/src/android/ndk.rs

However, the dream of wanting to build full desktop, web, and mobile compilation targets in a single project seems feasible enough with Rust, Iced, wgpu, and cargo mobile.

So if I wanted to print "Hello World" to the screen then it would be the exact same code, right?

The idea would be to write, say, an app that displays the text "Hello World" and to use rust cfg target attribute and/or feature macros to break up whatever needed to be different on each platform, but keep the majority of business and presentation logic the same.

@Joe23232
Copy link
Author

I'm not familiar with Android development, but I'm wondering if they reimplemented some of what android-ndk-rs does in here: https://github.com/BrainiumLLC/cargo-mobile/blob/master/src/android/ndk.rs

Interesting

The idea would be to write, say, an app that displays the text "Hello World" and to use rust cfg target attribute and/or feature macros to break up whatever needed to be different on each platform, but keep the majority of business and presentation logic the same.

That sounds pretty good, so I suppose tries to adhere to the philosophy "Write once, run everywhere"?

@cryptoquick
Copy link

That's the dream! Still early days in Rust. Who knows, maybe in a couple of years, Iced might be replacing Flutter and Ionic in people's apps, and Iced would be adding TUI, JSON-RPC, GraphQL, and headless testing targets. Sigh. A guy can dream. Everything's moving to Rust.

In a week or so, @dvc94ch , I'll be working on upgrading Fuzzr to the latest ipfs_embed. I want to get started on a Gemini renderer, which Iced could be decent at. With IPFS embedded in the browser, every browser would be a server... Just how it should've been in the first place.

@Joe23232
Copy link
Author

That's the dream! Still early days in Rust. Who knows, maybe in a couple of years, Iced might be replacing Flutter and Ionic in people's apps, and Iced would be adding TUI, JSON-RPC, GraphQL, and headless testing targets. Sigh. A guy can dream. Everything's moving to Rust.

I really hope that =D

In a week or so, @dvc94ch , I'll be working on upgrading Fuzzr to the latest ipfs_embed. I want to get started on a Gemini renderer, which Iced could be decent at. With IPFS embedded in the browser, every browser would be a server... Just how it should've been in the first place.

Sorry mate but what is Fuzzer?

@dvc94ch
Copy link
Contributor

dvc94ch commented Feb 19, 2021

So I think the discussion might be going off topic.

The difference between cargo apk and cargo mobile is (apart from that they were developed at roughly the same time) is that cargo mobile requires Android studio and some Java boilerplate to work and here we don't need either, but I might be mistaken.

@francesca64
Copy link
Contributor

francesca64 commented Feb 19, 2021

This discussion has definitely gone off topic, so please direct any further cargo-mobile questions/discussion to BrainiumLLC/cargo-mobile#23, and anything else that's not related to android-ndk-rs to anywhere else.

cargo mobile requires Android studio and some Java boilerplate to work

It actually doesn't have any Java boilerplate, though it does generate every other flavor of boilerplate under the sun, so you might as well be right. I also don't believe Android Studio is required, though gradle is.

The difference in a nutshell is that cargo-apk is a cool standalone tool for building your Rust project as an APK, whereas cargo-mobile is designed to integrate with Android Studio and Xcode. They both give you an APK in the end, but follow two different equally-valid approaches to getting there.

@francesca64 francesca64 added the type: question There's no such thing as a stupid one label Feb 19, 2021
@cryptoquick
Copy link

That's a great explanation, thank you, @francesca64 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question There's no such thing as a stupid one
Projects
None yet
Development

No branches or pull requests

4 participants