Skip to content

Commit 3c06ff4

Browse files
authored
Merge pull request #379 from firebase/mea-storage-emulator-android-snippets
Get Storage emulator connect snippet that is currently hard-coded in docs into repo
2 parents a0de4f5 + 087bd7b commit 3c06ff4

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.google.firebase.referencecode.storage;
2+
3+
import com.google.firebase.storage.FirebaseStorage;
4+
5+
public class EmulatorSuite {
6+
7+
public void emulatorSettings() {
8+
// [START storage_emulator_connect]
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);
13+
// [END storage_emulator_connect]
14+
}
15+
16+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.google.firebase.referencecode.storage.kotlin
2+
3+
import com.google.firebase.storage.FirebaseStorage
4+
import com.google.firebase.storage.ktx.storage
5+
import com.google.firebase.ktx.Firebase
6+
7+
class EmulatorSuite {
8+
9+
fun emulatorSettings() {
10+
// [START storage_emulator_connect]
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)
15+
// [END storage_emulator_connect]
16+
}
17+
18+
}

0 commit comments

Comments
 (0)