You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/immersive-reader/includes/quickstarts/immersive-reader-client-library-csharp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Create a new project in Visual Studio, using the ASP.NET Core Web Application te
35
35
Right-click on the project in the **Solution Explorer** and choose **Manage User Secrets**. This opens a file called *secrets.json*. This file isn't checked into source control. To learn more, see [Safe storage of app secrets](/aspnet/core/security/app-secrets?tabs=windows). Replace the contents of *secrets.json* with the following, supplying the values given when you created your Immersive Reader resource.
36
36
37
37
> [!IMPORTANT]
38
-
> Remember to never post secrets publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](/azure/key-vault/general/overview).
38
+
> Remember to never post secrets publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../../key-vault/general/overview.md).
Copy file name to clipboardExpand all lines: articles/ai-services/immersive-reader/includes/quickstarts/immersive-reader-client-library-java-android.md
Copy file name to clipboardExpand all lines: articles/ai-services/immersive-reader/includes/quickstarts/immersive-reader-client-library-kotlin.md
+35-31Lines changed: 35 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,49 +19,53 @@ In this quickstart, you build an Android app from scratch and integrate the Imme
19
19
* An Azure subscription. You can [create one for free](https://azure.microsoft.com/free/ai-services).
20
20
* An Immersive Reader resource configured for Microsoft Entra authentication. Follow [these instructions](../../how-to-create-immersive-reader.md) to get set up. Save the output of your session into a text file so you can configure the environment properties.
Start a new project in Android Studio. Source code for this example is available as part of the [Immersive Reader SDK](https://github.com/microsoft/immersive-reader-sdk/tree/master/js/samples/quickstart-kotlin).
:::image type="content" source="../../media/android/kotlin/android-studio-create-project.png" alt-text="Screenshot of the Start new project option in Android Studio.":::
30
29
31
-
In the **Choose your project** window, select **Empty Activity**, and then select **Next**.
30
+
In the **Templates** window, select **Empty Views Activity**, and then select **Next**.
:::image type="content" source="../../media/android/kotlin/android-studio-empty-activity.png" alt-text="Screenshot of the Templates window in Android Studio.":::
34
33
35
34
## Configure the project
36
35
37
36
Name the project **QuickstartKotlin**, and select a location to save it. Select **Kotlin** as the programming language, and then select **Finish**.
38
37
39
-

38
+
:::image type="content" source="../../media/android/kotlin/android-studio-configure-project.png" alt-text="Screenshot of the Configure project window in Android Studio.":::
40
39
41
40
## Set up assets and authentication
42
41
43
-
Create a new **/assets** folder.
42
+
Create a new */assets* folder. Right-click on **app** and select **Folder** -> **Assets Folder** from the dropdown.
44
43
45
-

44
+
:::image type="content" source="../../media/android/kotlin/android-studio-assets-folder.png" alt-text="Screenshot of the Assets folder option.":::
46
45
47
-
Create a file named**env**inside the assets folder. Add the following names and values, and supply values as appropriate. Don't commit this env file into source control because it contains secrets that shouldn't be made public.
46
+
Right-click on **assets** and select**New**-> **File**. Name the file **env**.
48
47
49
-
> [!IMPORTANT]
50
-
> Remember to never post secrets publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../../key-vault/general/overview.md).
48
+
:::image type="content" source="../../media/android/kotlin/android-studio-create-env-file.png" alt-text="Screenshot of name input field to create the env file.":::
51
49
52
-

50
+
Add the following names and values, and supply values as appropriate. Don't commit this envfile into source control because it contains secrets that shouldn't be made public.
53
51
54
52
```text
55
53
TENANT_ID=<YOUR_TENANT_ID>
56
54
CLIENT_ID=<YOUR_CLIENT_ID>
57
55
CLIENT_SECRET=<YOUR_CLIENT_SECRET>
58
56
SUBDOMAIN=<YOUR_SUBDOMAIN>
59
57
```
60
-

58
+
59
+
:::image type="content" source="../../media/android/kotlin/android-studio-assets-and-env-file.png" alt-text="Screenshot of Environment variables in Android Studio.":::
60
+
61
+
> [!IMPORTANT]
62
+
> Remember to never post secrets publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../../key-vault/general/overview.md).
61
63
62
64
## Add dependencies
63
65
64
-
Replace the existing dependencies in the **build.gradle** file with the following implementations to enable coroutines (asynchronous programming), gson (JSON parsing and serialization), and dotenv to reference the variables defined in the env file. You might need to sync the project again when you implement MainActivity.kt in a later step in this quickstart.
66
+
Replace the existing dependencies in the *build.gradle* file with the following implementations to enable coroutines (asynchronous programming), gson (JSON parsing and serialization), and dotenv to reference the variables defined in the env file. You might need to sync the project again when you implement *MainActivity.kt* in a later step in this quickstart.
67
+
68
+
:::image type="content" source="../../media/android/kotlin/android-studio-build-gradle.png" alt-text="Screenshot of app gradle dependencies.":::
:::image type="content" source="../../media/android/kotlin/android-studio-strings.png" alt-text="Screenshot of the app strings xml file.":::
90
92
91
93
```strings.xml
92
94
<resources>
@@ -102,9 +104,9 @@ Replace the content in **res/strings/strings.xml** with the following strings to
102
104
</resources>
103
105
```
104
106
105
-
Replace the content in **res/layout/activity_main.xml** with the following XML to be used in the app. This XML is the UI layout of the app.
107
+
Replace the content in *res/layout/activity_main.xml* with the following XML to be used in the app. This XML is the UI layout of the app. If you don't see the code in the *activity_main.xml* file, right-click on the canvas and select **Go to XML**.
:::image type="content" source="../../media/android/kotlin/android-studio-activity-main-xml.png" alt-text="Screenshot of the app activity mail xml file.":::
108
110
109
111
```activity_main.xml
110
112
<?xml version="1.0" encoding="utf-8"?>
@@ -203,11 +205,11 @@ Replace the content in **res/layout/activity_main.xml** with the following XML t
203
205
204
206
## Set up the app Kotlin code JavaScript interface
205
207
206
-
In the **/Java/com.example.quickstartkotlin** folder, create a new Kotlin class and name it **WebAppInterface**. Then add the following code to it. This code enables the app to interface with JavaScript functions in HTML that will be added in a later step.
208
+
In the *kotlin+java/com.example.quickstartkotlin/* folder, create a new Kotlin class and name it `WebAppInterface`. Then add the following code to it. This code enables the app to interface with JavaScript functions in HTML that will be added in a later step.
:::image type="content" source="../../media/android/kotlin/android-studio-web-app-interface.png" alt-text="Screenshot of the WebAppInterface Kotlin class.":::
211
213
212
214
```WebAppInterface.kt
213
215
// Copyright (c) Microsoft Corporation. All rights reserved.
@@ -258,7 +260,7 @@ class WebAppInterface(private val mContext: Context, var parentLayout: LinearLay
258
260
259
261
## Set up the app Kotlin code Main Activity
260
262
261
-
In the **/Java/com.example.quickstartkotlin** folder, you'll see an existing **MainActivity.kt** Kotlin class file. This file is where the app logic is authored. Replace its contents with the following code:
263
+
In the *kotlin+java/com.example.quickstartkotlin/* folder, there's an existing *MainActivity.kt* Kotlin class file. This file is where the app logic is authored. Replace its contents with the following code.
262
264
263
265
```MainActivity.kt
264
266
// Copyright (c) Microsoft Corporation. All rights reserved.
@@ -515,15 +517,17 @@ class MainActivity : AppCompatActivity() {
515
517
}
516
518
```
517
519
520
+
You might need to sync the project again.
521
+
518
522
## Add the app HTML to the web view
519
523
520
-
The web view implementation needs HTML to work. Right-click the **/assets** folder, create a new file, and name it **immersiveReader.html**.
524
+
The web view implementation needs HTML to work. Right-click the */assets* folder, create a new file, and name it *immersiveReader.html*.
521
525
522
-

526
+
:::image type="content" source="../../media/android/kotlin/android-studio-immersive-reader-html.png" alt-text="Screenshot of the name input field for the new html file.":::
:::image type="content" source="../../media/android/kotlin/android-studio-immersive-reader-html-assets.png" alt-text="Screenshot of the html file location in the assets folder.":::
525
529
526
-
Add the following HTML and JavaScript. This code adds the Immersive Reader SDK to the app and uses it to open the Immersive Reader by using the app code we've written.
530
+
Add the following HTML and JavaScript. This code adds the Immersive Reader SDK to the app and uses it to open the Immersive Reader by using the app code we wrote.
527
531
528
532
```immersiveReader.html
529
533
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
@@ -570,9 +574,9 @@ Licensed under the MIT License. -->
Because the application needs to make network calls to the Immersive Reader SDK to function, we need to ensure the app permissions are configured to allow network access. Replace the content of */manifests/AndroidManifest.xml* with the following XML.
574
578
575
-
Because the application needs to make network calls to the Immersive Reader SDK to function, we need to ensure the app permissions are configured to allow network access. Replace the content of **/manifests/AndroidManifest.xml** with the following XML:
579
+
:::image type="content" source="../../media/android/kotlin/android-studio-android-manifest-xml.png" alt-text="Screenshot of the Android Manifest file.":::
576
580
577
581
```AndroidManifest.xml
578
582
<?xml version="1.0" encoding="utf-8"?>
@@ -604,7 +608,7 @@ Because the application needs to make network calls to the Immersive Reader SDK
604
608
605
609
Use Android Studio to run the app on a device emulator. When you select **Immersive Reader**, the Immersive Reader opens with the content on the app.
:::image type="content" source="../../media/android/kotlin/android-studio-device-emulator.png" alt-text="Screenshot of the Immersive Reader app running in the emulator.":::
Copy file name to clipboardExpand all lines: articles/ai-services/immersive-reader/includes/quickstarts/immersive-reader-client-library-nodejs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ npm install axios qs
49
49
Create a new file called *.env* in the root of your project. Paste the following code into it, supplying the values given when you created your Immersive Reader resource. Don't include quotation marks or the `{` and `}` characters.
50
50
51
51
> [!IMPORTANT]
52
-
> Remember to never post secrets publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](/azure/key-vault/general/overview).
52
+
> Remember to never post secrets publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../../key-vault/general/overview.md).
0 commit comments