-
Notifications
You must be signed in to change notification settings - Fork 72
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
Docs: Suggestions from following the Getting Started guide #220
Docs: Suggestions from following the Getting Started guide #220
Conversation
I've added a few pointers for things I got stuck on or had to check when following the 'Getting Started' guide in the book. Some of these will be helpful for Rust devs that aren't that familiar with app development, and others hopefully avoid getting stuck where there's sensitivity to exact naming or setup.
```admonish warning title="Sharp edge" | ||
You will need to set the `ndkVersion` to one you have installed, go to "**Tools, SDK Manager, SDK Tooks**" and check "**Show Package Details**" to get your installed version, or to install the version matching `build.gradle` above. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there's an easier way around this, like some way to say "latest"
? The error message if the version mismatches is an unhelpful NDK is not installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is good. Thanks!
* "Package name": `com.example.simple_counter` | ||
* "Save Location": a directory called `Android` at the root of our monorepo | ||
* "Minimum SDK" `API 34` | ||
* "Build configuration language": `Groovy DSL (build.gradle)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me Android Studio was defaulting to build.gradle.kts
build files, which ofc won't then work with the copy-pastes later.
"Empty Activity". In this walk-through, we'll call it "Counter" | ||
|
||
* "Name": `Counter` | ||
* "Package name": `com.example.simple_counter` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is important, e.g. if I chose a different namespace like com.random_tutorials.simple_counter
you'd then have a problem later as the shared
library will be in the com.example.
namespace? (Maybe I'm wrong, I'm not an Android/Java dev 😅)
I did also wonder, for iOS you add the targets to [toolchain]
channel = "stable"
components = ["rustfmt", "rustc-dev"]
targets = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-apple-ios-sim",
"aarch64-linux-android",
"wasm32-unknown-unknown",
"x86_64-apple-ios"
]
profile = "minimal" Why don't you also add the Android ones, that instead we installed by manually running $ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android to have this: [toolchain]
channel = "stable"
components = ["rustfmt", "rustc-dev"]
targets = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-apple-ios-sim",
"aarch64-linux-android",
"armv7-linux-androideabi",
"i686-linux-android",
"wasm32-unknown-unknown",
"x86_64-apple-darwin",
"x86_64-apple-ios",
"x86_64-linux-android",
]
profile = "minimal" |
Last point I'm not sure about is your dependencies {
// our shared library
implementation project(path: ':shared')
def composeBom = platform('androidx.compose:compose-bom:2022.10.00')
implementation composeBom
androidTestImplementation composeBom
implementation 'androidx.compose.material3:material3:1.2.0-beta01'
...
} whereas the ones Android Studio generated for me look like dependencies {
// our shared library
implementation project(path: ":shared")
implementation libs.androidx.core.ktx
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.activity.compose
...
} It wasn't that hard to mentally diff them and add the bits needed but it's a little confusing for a noob! I'd hazard a guess it's best-practice to give fixed versions but for a tutorial that might also be a bit brittle (i.e. might just stop working in a few months/years?) (I did also have to click something that then added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this — much appreciated.
```admonish warning title="Sharp edge" | ||
You will need to set the `ndkVersion` to one you have installed, go to "**Tools, SDK Manager, SDK Tooks**" and check "**Show Package Details**" to get your installed version, or to install the version matching `build.gradle` above. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is good. Thanks!
I've added a few pointers for things I got stuck on or had to check when following the 'Getting Started' guide in the book.
Some of these will be helpful for Rust devs that aren't that familiar with app development, and others hopefully avoid getting stuck where there's sensitivity to exact naming or setup.