Saving Data on Android



Download 19,28 Mb.
Pdf ko'rish
bet290/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   284   285   286   287   288   289   290   291   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

HomeActivity.kt
, navigate to 
onActivityResult()
 and replace it with 
following code:
override
 fun onActivityResult(requestCode: 
Int
, resultCode: 
Int

data: 
Intent
?) { 
  
super
.onActivityResult(requestCode, resultCode, data) 
  
if
 (requestCode == 
CHOOSE_IMAGE_REQUEST_CODE
 && resultCode == 
Activity
.
RESULT_OK
) { 
    val selectedImageUri = data?.data ?: 
return
 
    
cloudStorageManager.uploadPhoto(selectedImageUri, ::onPhotoUploa
dSuccess) 
  } 
}
Here, you get the URI of the selected image and pass it to 
uploadPhoto()
 in the 
cloudStorageManager
.
Build and run your app. Now, when you select an image from the File Explorer, it will 
upload to Cloud Storage.
Saving Data on Android
Chapter 20: Cloud Storage
raywenderlich.com
286


When the upload finishes, you'll display the image on the home screen:
Go to Firebase console and open your app's storage. You'll see the photo you 
uploaded in the 
photos
 folder:
Awesome! You've successfully connected your app to Firebase Cloud Storage!
Saving Data on Android
Chapter 20: Cloud Storage
raywenderlich.com
287



Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   284   285   286   287   288   289   290   291   292




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish