Skip to content

Commit 3dc86f2

Browse files
committed
Let's do this properly, analagously to RTDB snippets.
1 parent 679b772 commit 3dc86f2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

storage/app/src/main/java/com/google/firebase/referencecode/storage/EmulatorSuite.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ public class EmulatorSuite {
66

77
public void emulatorSettings() {
88
// [START storage_emulator_connect]
9-
FirebaseStorage.getInstance().useEmulator("10.0.2.2", 9199);
9+
// 10.0.2.2 is the special IP address to connect to the 'localhost' of
10+
// the host computer from an Android emulator.
11+
FirebaseStorage storage = FirebaseStorage.getInstance();
12+
storage.useEmulator("10.0.2.2", 9199);
1013
// [END storage_emulator_connect]
1114
}
1215

storage/app/src/main/java/com/google/firebase/referencecode/storage/kotlin/EmulatorSuite.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ class EmulatorSuite {
88

99
fun emulatorSettings() {
1010
// [START storage_emulator_connect]
11-
Firebase.storage.useEmulator("10.0.2.2", 9199);
11+
// 10.0.2.2 is the special IP address to connect to the 'localhost' of
12+
// the host computer from an Android emulator.
13+
val storage = Firebase.storage
14+
storage.useEmulator("10.0.2.2", 9199);
1215
// [END storage_emulator_connect]
1316
}
1417

0 commit comments

Comments
 (0)