firebase storage getting downloadURL problemIntent problem, return value (Android)Get screen dimensions in pixelsjava.lang.NullPointerException for static field in Android library projectsetText on button from another activity androidAdding Social Media Share Logic From Firebase in AndroidActivity can still call unbind service method. Is it normal?java.lang.NullPointerException when invoking onLoadFinished()Search Firestore query don't show data in RecycleViewAndroid: Multiple image viewHow to add child(Product) under a child(Store) in Firebase Database using RecyclerView
How valuable is a categorical feature that has a predominant category over all other ones?
How did the European Union reach the figure of 3% as a maximum allowed deficit?
Does knowing the surface area of all faces uniquely determine a tetrahedron?
Co-worker is now managing my team. Does this mean that I'm being demoted?
Why was New Asgard established at this place?
Are there any individual aliens that have gained superpowers in the Marvel universe?
How can I prevent a user from copying files on another hard drive?
Are there examples of rowers who also fought?
How to write a nice frame challenge?
Why do you need to heat the pan before heating the olive oil?
I have found ports on my Samsung smart tv running a display service. What can I do with it?
I'm yearning in grey
How "fast" do astronomical events occur?
...and then she held the gun
How did Frodo know where the Bree village was?
What is this airplane that sits in front of Barringer High School in Newark, NJ?
What does this Swiss black on yellow rectangular traffic sign with a symbol looking like a dart mean?
SQL Server has encountered occurences of I/O requests taking longer than 15 seconds
Basic power tool set for Home repair and simple projects
In a Fish that is not a Fish
Does anyone recognize these rockets, and their location?
Is a sequel allowed to start before the end of the first book?
What is the precise meaning of "подсел на мак"?
Print the new site header
firebase storage getting downloadURL problem
Intent problem, return value (Android)Get screen dimensions in pixelsjava.lang.NullPointerException for static field in Android library projectsetText on button from another activity androidAdding Social Media Share Logic From Firebase in AndroidActivity can still call unbind service method. Is it normal?java.lang.NullPointerException when invoking onLoadFinished()Search Firestore query don't show data in RecycleViewAndroid: Multiple image viewHow to add child(Product) under a child(Store) in Firebase Database using RecyclerView
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
when i tried to get the download URL for my image in firebase storage I got something weird i got this result
com.google.android.gms.tasks.zzu@3a6d712
and here is my code
public class MainActivity extends AppCompatActivity
private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);
);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());
);
);
so how to get the right download URL to download the image into image view using picasso
android
add a comment |
when i tried to get the download URL for my image in firebase storage I got something weird i got this result
com.google.android.gms.tasks.zzu@3a6d712
and here is my code
public class MainActivity extends AppCompatActivity
private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);
);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());
);
);
so how to get the right download URL to download the image into image view using picasso
android
format & compress code
– pirho
Mar 25 at 6:45
add a comment |
when i tried to get the download URL for my image in firebase storage I got something weird i got this result
com.google.android.gms.tasks.zzu@3a6d712
and here is my code
public class MainActivity extends AppCompatActivity
private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);
);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());
);
);
so how to get the right download URL to download the image into image view using picasso
android
when i tried to get the download URL for my image in firebase storage I got something weird i got this result
com.google.android.gms.tasks.zzu@3a6d712
and here is my code
public class MainActivity extends AppCompatActivity
private StorageReference mStorage;
private ProgressDialog mProgressDialog;
private static final int GALLERY_REQUEST_CODE = 1;
private static final int CAMERA_REQUEST_CODE = 2;
private Button uploadButton;
private Button captureButton;
ImageView imageViewBig, imageViewSmall;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mStorage = FirebaseStorage.getInstance().getReference();
mProgressDialog = new ProgressDialog(this);
imageViewBig = findViewById(R.id.imageViewBig);
imageViewSmall = findViewById(R.id.imageViewSmall);
captureButton = findViewById(R.id.captureButton);
uploadButton = findViewById(R.id.uploadButton);
captureButton.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, GALLERY_REQUEST_CODE);
);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY_REQUEST_CODE && resultCode == RESULT_OK)
Uri uri = data.getData();
StorageReference filePath = mStorage.child("photos").child(uri.getLastPathSegment());
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(final UploadTask.TaskSnapshot taskSnapshot)
Toast.makeText(MainActivity.this, "DONE", Toast.LENGTH_SHORT).show();
imageViewBig.setBackgroundColor(Color.GREEN);
imageViewBig.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
Log.i("URL", taskSnapshot.getMetadata().getReference().getDownloadUrl().toString());
);
);
so how to get the right download URL to download the image into image view using picasso
android
android
edited Mar 25 at 6:45
pirho
5,299122132
5,299122132
asked Mar 25 at 5:11
ANDROID_BIGGENERANDROID_BIGGENER
82
82
format & compress code
– pirho
Mar 25 at 6:45
add a comment |
format & compress code
– pirho
Mar 25 at 6:45
format & compress code
– pirho
Mar 25 at 6:45
format & compress code
– pirho
Mar 25 at 6:45
add a comment |
3 Answers
3
active
oldest
votes
UploadTask
public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>
An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.
Example
final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();
StorageReference postPhotos = firebaseStorage.child("photos/");
final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());
//uri = uri of your file which you want to update
UploadTask uploadTask = upload_Image.putFile(uri);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
//downloadable uri
Uri path = task.getResult();
);
);
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes toupload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
|
show 1 more comment
Use this Code to upload File on firebase and get download url for that file
Uri file = Uri.fromFile(new File(aadhaarPath));
final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
uploadTask = riversRef.putFile(file);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
progressDialog.dismiss();
).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
// get the image Url of the file uploaded
riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
Uri downloadUrl = uri;
aadharDownloadUrl = downloadUrl.toString();
uploadPanCard(panCardPath);
);
);
aadhaarPath is file path that you selected to upload
and add this in your build .gradle
implementation 'com.google.firebase:firebase-storage:16.0.3'
add a comment |
I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReference();
StorageReference imageRef = storageRef.child(PHOTO_NAME);
GlideApp.with(mContext).load(islandRef).into(viewHolder.image);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331560%2ffirebase-storage-getting-downloadurl-problem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
UploadTask
public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>
An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.
Example
final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();
StorageReference postPhotos = firebaseStorage.child("photos/");
final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());
//uri = uri of your file which you want to update
UploadTask uploadTask = upload_Image.putFile(uri);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
//downloadable uri
Uri path = task.getResult();
);
);
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes toupload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
|
show 1 more comment
UploadTask
public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>
An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.
Example
final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();
StorageReference postPhotos = firebaseStorage.child("photos/");
final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());
//uri = uri of your file which you want to update
UploadTask uploadTask = upload_Image.putFile(uri);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
//downloadable uri
Uri path = task.getResult();
);
);
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes toupload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
|
show 1 more comment
UploadTask
public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>
An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.
Example
final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();
StorageReference postPhotos = firebaseStorage.child("photos/");
final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());
//uri = uri of your file which you want to update
UploadTask uploadTask = upload_Image.putFile(uri);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
//downloadable uri
Uri path = task.getResult();
);
);
UploadTask
public class UploadTask extends StorageTask<UploadTask.TaskSnapshot>
An controllable task that uploads and fires events for success, progress and failure. It also allows pause and resume to control the upload operation.
Example
final StorageReference firebaseStorage = FirebaseStorage.getInstance().getReference();
StorageReference postPhotos = firebaseStorage.child("photos/");
final StorageReference upload_Image = postPhotos.child(uri.getLastPathSegment());
//uri = uri of your file which you want to update
UploadTask uploadTask = upload_Image.putFile(uri);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
upload_Image.getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>()
@Override
public void onComplete(@NonNull Task<Uri> task)
if (task.isSuccessful())
//downloadable uri
Uri path = task.getResult();
);
);
edited Mar 25 at 11:49
answered Mar 25 at 8:43
Ashvin solankiAshvin solanki
1,789831
1,789831
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes toupload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
|
show 1 more comment
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes toupload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
where is the variable file in this line of code come from . UploadTask uploadTask = upload_Image.putFile(Uri.fromFile(file));
– ANDROID_BIGGENER
Mar 25 at 11:40
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to
upload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER putFile takking uri of your file which you want to upadate now editted the answare and make changes to
upload_Image.putFile(uri);
– Ashvin solanki
Mar 25 at 11:50
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
@ANDROID_BIGGENER let me see if its not work....
– Ashvin solanki
Mar 25 at 11:52
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
thanks very much dear it worked 😘
– ANDROID_BIGGENER
Mar 25 at 12:10
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
@ANDROID_BIGGENER glad to help you mark as accepted if its work
– Ashvin solanki
Mar 25 at 12:12
|
show 1 more comment
Use this Code to upload File on firebase and get download url for that file
Uri file = Uri.fromFile(new File(aadhaarPath));
final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
uploadTask = riversRef.putFile(file);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
progressDialog.dismiss();
).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
// get the image Url of the file uploaded
riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
Uri downloadUrl = uri;
aadharDownloadUrl = downloadUrl.toString();
uploadPanCard(panCardPath);
);
);
aadhaarPath is file path that you selected to upload
and add this in your build .gradle
implementation 'com.google.firebase:firebase-storage:16.0.3'
add a comment |
Use this Code to upload File on firebase and get download url for that file
Uri file = Uri.fromFile(new File(aadhaarPath));
final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
uploadTask = riversRef.putFile(file);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
progressDialog.dismiss();
).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
// get the image Url of the file uploaded
riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
Uri downloadUrl = uri;
aadharDownloadUrl = downloadUrl.toString();
uploadPanCard(panCardPath);
);
);
aadhaarPath is file path that you selected to upload
and add this in your build .gradle
implementation 'com.google.firebase:firebase-storage:16.0.3'
add a comment |
Use this Code to upload File on firebase and get download url for that file
Uri file = Uri.fromFile(new File(aadhaarPath));
final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
uploadTask = riversRef.putFile(file);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
progressDialog.dismiss();
).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
// get the image Url of the file uploaded
riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
Uri downloadUrl = uri;
aadharDownloadUrl = downloadUrl.toString();
uploadPanCard(panCardPath);
);
);
aadhaarPath is file path that you selected to upload
and add this in your build .gradle
implementation 'com.google.firebase:firebase-storage:16.0.3'
Use this Code to upload File on firebase and get download url for that file
Uri file = Uri.fromFile(new File(aadhaarPath));
final StorageReference riversRef = storageRef.child("documents/" + file.getLastPathSegment());
uploadTask = riversRef.putFile(file);
uploadTask.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception exception)
progressDialog.dismiss();
).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>()
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)
// get the image Url of the file uploaded
riversRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>()
@Override
public void onSuccess(Uri uri)
Uri downloadUrl = uri;
aadharDownloadUrl = downloadUrl.toString();
uploadPanCard(panCardPath);
);
);
aadhaarPath is file path that you selected to upload
and add this in your build .gradle
implementation 'com.google.firebase:firebase-storage:16.0.3'
answered Mar 25 at 5:26
Sandeep ParishSandeep Parish
1,2361316
1,2361316
add a comment |
add a comment |
I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReference();
StorageReference imageRef = storageRef.child(PHOTO_NAME);
GlideApp.with(mContext).load(islandRef).into(viewHolder.image);
add a comment |
I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReference();
StorageReference imageRef = storageRef.child(PHOTO_NAME);
GlideApp.with(mContext).load(islandRef).into(viewHolder.image);
add a comment |
I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReference();
StorageReference imageRef = storageRef.child(PHOTO_NAME);
GlideApp.with(mContext).load(islandRef).into(viewHolder.image);
I save photos to Firebase storage and the image name to Firebase realtime database and than i am using Glide to load images from Firebase Storage:
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageRef = storage.getReference();
StorageReference imageRef = storageRef.child(PHOTO_NAME);
GlideApp.with(mContext).load(islandRef).into(viewHolder.image);
answered Mar 25 at 8:03
nadav tamimnadav tamim
367
367
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55331560%2ffirebase-storage-getting-downloadurl-problem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
format & compress code
– pirho
Mar 25 at 6:45