Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Fix Markdown rendering issues #48

Open
wants to merge 5 commits 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ We will create several new files in our project to implement this.
## Updating Gradle Scripts

The `SharedCode` sub-project should generate several artifacts for us:

- A JAR file for the Android project, from the `androidMain` source set
- The Apple framework
- for iOS device and App Store (`arm64` target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Let's patch the
(the name may be different if we changed it in the new project wizard).
Select the _Text_ tab at the bottom of the preview to switch it to XML
and add several more attributes to the `<TextView>` element:
```

```xml
android:id="@+id/main_text"
android:textSize="42sp"
android:layout_margin="5sp"
Expand All @@ -30,14 +31,15 @@ and add several more attributes to the `<TextView>` element:
Next, let's add the following line of code to the end of the `onCreate` method from the `MainActivity` class
in the `/app/src/main/java/com/jetbrains/handson/mpp/mobile/MainActivity.kt` file, :

```
```kotlin
findViewById<TextView>(R.id.main_text).text = createApplicationScreenMessage()
```

You will need to add the import for the `android.widget.TextView` class. Android Studio
will automatically suggest adding the import. Depending on the Android application package,
we may also need to add the import for the `createApplicationScreenMessage()` function too.
We should see these two lines at the beginning of the `MainActivity.kt` file:

```kotlin
import com.jetbrains.handson.mpp.mobile.createApplicationScreenMessage
import android.widget.TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ from console. This task is designed to help to simplify the setup of our iOS Fra
in the Xcode project model.

We need several binaries from the framework to use it with Xcode:
- `iOS arm64 debug` --- the binary to run the iOS device in debug mode
- `iOS arm64 release` --- the binary to include into a release version of an app
- `iOS x64 debug` --- the binary for iOS simulator, which uses the desktop mac CPU

- `iOS arm64 debug` to run on the iOS device in debug mode
- `iOS arm64 release` to include into a release version of an app
- `iOS x64 debug` for the iOS Simulator, which uses the desktop Mac CPU

The easiest way to configure Xcode to use a custom-built framework is to
place the framework under the same folder for all configurations and targets.
Expand All @@ -30,6 +31,7 @@ To do this we can double-click on the `KotlinIOS` node (or root node) of the *pr
to open the *target* settings.
Next we then click on the `+` in the *Embedded Binaries* section, click *Add Other...* button in the dialog
to choose the framework from the disk. We can then point to the following folder:

```
SharedCode/build/xcode-frameworks/SharedCode.framework
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Summary

In the tutorial we:

- Created an Android application in Android Studio
- Created an iOS application in Xcode
- Added Kotlin multiplatform sub-project
- Added Kotlin multiplatform sub-project
- with shared Kotlin code
- compiled it to Android Jar
- compiled it to iOS Framework
- Put it all together and re-used Kotlin code

We can find all the sources from that tutorial at [GitHub](https://github.com/JetBrains/kotlin-examples/tree/master/tutorials/mpp-iOS-Android).

# Next Steps
Expand Down