android how to add byte[] data to cloud firestore databaseHow does database indexing work?How do I quickly rename a MySQL database (change schema name)?How to list the tables in a SQLite database file that was opened with ATTACH?How do save an Android Activity state using save instance state?Why is the Android emulator so slow? How can we speed up the Android emulator?How do I pass data between Activities in Android application?How do I display an alert dialog on Android?What are the options for storing hierarchical data in a relational database?How do I add a library project to Android Studio?Android Studio: Add jar as library?
Should I stop contributing to retirement accounts?
On a tidally locked planet, would time be quantized?
Offered money to buy a house, seller is asking for more to cover gap between their listing and mortgage owed
Which one is correct as adjective “protruding” or “protruded”?
Why should universal income be universal?
If a character has darkvision, can they see through an area of nonmagical darkness filled with lightly obscuring gas?
Multiplicative persistence
What is Cash Advance APR?
Non-trope happy ending?
Create all possible words using a set or letters
How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?
Creature in Shazam mid-credits scene?
Why did the HMS Bounty go back to a time when whales are already rare?
Why electric field inside a cavity of a non-conducting sphere not zero?
Redundant comparison & "if" before assignment
Melting point of aspirin, contradicting sources
If infinitesimal transformations commute why dont the generators of the Lorentz group commute?
Store Credit Card Information in Password Manager?
Not using 's' for he/she/it
What is this called? Old film camera viewer?
What should you do when eye contact makes your subordinate uncomfortable?
Closed-form expression for certain product
Why does the Sun have different day lengths, but not the gas giants?
Is the U.S. Code copyrighted by the Government?
android how to add byte[] data to cloud firestore database
How does database indexing work?How do I quickly rename a MySQL database (change schema name)?How to list the tables in a SQLite database file that was opened with ATTACH?How do save an Android Activity state using save instance state?Why is the Android emulator so slow? How can we speed up the Android emulator?How do I pass data between Activities in Android application?How do I display an alert dialog on Android?What are the options for storing hierarchical data in a relational database?How do I add a library project to Android Studio?Android Studio: Add jar as library?
I have tried to upload my data of local database to Cloud Firestore database, and the data type of one field is byte[]. It can't be success or failure.
Map<String, Object> setDetail = new HashMap<>();
j = cursor.getColumnIndex("sound");
byte[] sound = cursor.getBlob(j);
setDetail.put("sound", sound);
dbFire.collection("SetDetails").document(strWordID).set(setDetail)
.addOnSuccessListener(new OnSuccessListener<Void>()
@Override
public void onSuccess(Void aVoid)
)
.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
The debugger steps over this line dbFire.collection("SetDetails").document(strWordID).set(setDetail)
then jumps out to the last line of zzj.class
final class zzj implements Runnable
zzj(zzi var1, Task var2)
this.zzm = var1;
this.zzg = var2;
public final void run()
synchronized(zzi.zza(this.zzm))
if (zzi.zzb(this.zzm) != null)
zzi.zzb(this.zzm).onComplete(this.zzg);
If I continue running, it will jump to this line of Looper.java
final int thresholdOverride =
SystemProperties.getInt("log.looper."
+ Process.myUid() + "."
+ Thread.currentThread().getName()
+ ".slow", 0);
I have read documents, Bytes is one of data types that Cloud Firestore supports, so what's wrong with it. Could anyone help me? Thanks!
android database google-cloud-firestore
New contributor
add a comment |
I have tried to upload my data of local database to Cloud Firestore database, and the data type of one field is byte[]. It can't be success or failure.
Map<String, Object> setDetail = new HashMap<>();
j = cursor.getColumnIndex("sound");
byte[] sound = cursor.getBlob(j);
setDetail.put("sound", sound);
dbFire.collection("SetDetails").document(strWordID).set(setDetail)
.addOnSuccessListener(new OnSuccessListener<Void>()
@Override
public void onSuccess(Void aVoid)
)
.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
The debugger steps over this line dbFire.collection("SetDetails").document(strWordID).set(setDetail)
then jumps out to the last line of zzj.class
final class zzj implements Runnable
zzj(zzi var1, Task var2)
this.zzm = var1;
this.zzg = var2;
public final void run()
synchronized(zzi.zza(this.zzm))
if (zzi.zzb(this.zzm) != null)
zzi.zzb(this.zzm).onComplete(this.zzg);
If I continue running, it will jump to this line of Looper.java
final int thresholdOverride =
SystemProperties.getInt("log.looper."
+ Process.myUid() + "."
+ Thread.currentThread().getName()
+ ".slow", 0);
I have read documents, Bytes is one of data types that Cloud Firestore supports, so what's wrong with it. Could anyone help me? Thanks!
android database google-cloud-firestore
New contributor
Have you tried to log the exception, what does it say?
– Alex Mamo
2 days ago
@AlexMamo Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'sound')
– Citrin
2 days ago
So it's very clear, right? You should change the type from array to list.
– Alex Mamo
2 days ago
Thank you, I'll try it.
– Citrin
2 days ago
Ok and tell me if it works.
– Alex Mamo
2 days ago
add a comment |
I have tried to upload my data of local database to Cloud Firestore database, and the data type of one field is byte[]. It can't be success or failure.
Map<String, Object> setDetail = new HashMap<>();
j = cursor.getColumnIndex("sound");
byte[] sound = cursor.getBlob(j);
setDetail.put("sound", sound);
dbFire.collection("SetDetails").document(strWordID).set(setDetail)
.addOnSuccessListener(new OnSuccessListener<Void>()
@Override
public void onSuccess(Void aVoid)
)
.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
The debugger steps over this line dbFire.collection("SetDetails").document(strWordID).set(setDetail)
then jumps out to the last line of zzj.class
final class zzj implements Runnable
zzj(zzi var1, Task var2)
this.zzm = var1;
this.zzg = var2;
public final void run()
synchronized(zzi.zza(this.zzm))
if (zzi.zzb(this.zzm) != null)
zzi.zzb(this.zzm).onComplete(this.zzg);
If I continue running, it will jump to this line of Looper.java
final int thresholdOverride =
SystemProperties.getInt("log.looper."
+ Process.myUid() + "."
+ Thread.currentThread().getName()
+ ".slow", 0);
I have read documents, Bytes is one of data types that Cloud Firestore supports, so what's wrong with it. Could anyone help me? Thanks!
android database google-cloud-firestore
New contributor
I have tried to upload my data of local database to Cloud Firestore database, and the data type of one field is byte[]. It can't be success or failure.
Map<String, Object> setDetail = new HashMap<>();
j = cursor.getColumnIndex("sound");
byte[] sound = cursor.getBlob(j);
setDetail.put("sound", sound);
dbFire.collection("SetDetails").document(strWordID).set(setDetail)
.addOnSuccessListener(new OnSuccessListener<Void>()
@Override
public void onSuccess(Void aVoid)
)
.addOnFailureListener(new OnFailureListener()
@Override
public void onFailure(@NonNull Exception e)
);
The debugger steps over this line dbFire.collection("SetDetails").document(strWordID).set(setDetail)
then jumps out to the last line of zzj.class
final class zzj implements Runnable
zzj(zzi var1, Task var2)
this.zzm = var1;
this.zzg = var2;
public final void run()
synchronized(zzi.zza(this.zzm))
if (zzi.zzb(this.zzm) != null)
zzi.zzb(this.zzm).onComplete(this.zzg);
If I continue running, it will jump to this line of Looper.java
final int thresholdOverride =
SystemProperties.getInt("log.looper."
+ Process.myUid() + "."
+ Thread.currentThread().getName()
+ ".slow", 0);
I have read documents, Bytes is one of data types that Cloud Firestore supports, so what's wrong with it. Could anyone help me? Thanks!
android database google-cloud-firestore
android database google-cloud-firestore
New contributor
New contributor
edited 2 days ago
Citrin
New contributor
asked 2 days ago
CitrinCitrin
33
33
New contributor
New contributor
Have you tried to log the exception, what does it say?
– Alex Mamo
2 days ago
@AlexMamo Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'sound')
– Citrin
2 days ago
So it's very clear, right? You should change the type from array to list.
– Alex Mamo
2 days ago
Thank you, I'll try it.
– Citrin
2 days ago
Ok and tell me if it works.
– Alex Mamo
2 days ago
add a comment |
Have you tried to log the exception, what does it say?
– Alex Mamo
2 days ago
@AlexMamo Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'sound')
– Citrin
2 days ago
So it's very clear, right? You should change the type from array to list.
– Alex Mamo
2 days ago
Thank you, I'll try it.
– Citrin
2 days ago
Ok and tell me if it works.
– Alex Mamo
2 days ago
Have you tried to log the exception, what does it say?
– Alex Mamo
2 days ago
Have you tried to log the exception, what does it say?
– Alex Mamo
2 days ago
@AlexMamo Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'sound')
– Citrin
2 days ago
@AlexMamo Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'sound')
– Citrin
2 days ago
So it's very clear, right? You should change the type from array to list.
– Alex Mamo
2 days ago
So it's very clear, right? You should change the type from array to list.
– Alex Mamo
2 days ago
Thank you, I'll try it.
– Citrin
2 days ago
Thank you, I'll try it.
– Citrin
2 days ago
Ok and tell me if it works.
– Alex Mamo
2 days ago
Ok and tell me if it works.
– Alex Mamo
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
To write a byte array type field on Android, use Blob.fromBytes() to convert a byte array to a Blob object, then provide the Blob object to update()
or set()
.
Thank you very much, it works.
– Citrin
yesterday
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
);
);
Citrin is a new contributor. Be nice, and check out our Code of Conduct.
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%2f55281418%2fandroid-how-to-add-byte-data-to-cloud-firestore-database%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To write a byte array type field on Android, use Blob.fromBytes() to convert a byte array to a Blob object, then provide the Blob object to update()
or set()
.
Thank you very much, it works.
– Citrin
yesterday
add a comment |
To write a byte array type field on Android, use Blob.fromBytes() to convert a byte array to a Blob object, then provide the Blob object to update()
or set()
.
Thank you very much, it works.
– Citrin
yesterday
add a comment |
To write a byte array type field on Android, use Blob.fromBytes() to convert a byte array to a Blob object, then provide the Blob object to update()
or set()
.
To write a byte array type field on Android, use Blob.fromBytes() to convert a byte array to a Blob object, then provide the Blob object to update()
or set()
.
answered 2 days ago
Doug StevensonDoug Stevenson
81.9k997115
81.9k997115
Thank you very much, it works.
– Citrin
yesterday
add a comment |
Thank you very much, it works.
– Citrin
yesterday
Thank you very much, it works.
– Citrin
yesterday
Thank you very much, it works.
– Citrin
yesterday
add a comment |
Citrin is a new contributor. Be nice, and check out our Code of Conduct.
Citrin is a new contributor. Be nice, and check out our Code of Conduct.
Citrin is a new contributor. Be nice, and check out our Code of Conduct.
Citrin is a new contributor. Be nice, and check out our Code of Conduct.
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%2f55281418%2fandroid-how-to-add-byte-data-to-cloud-firestore-database%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
Have you tried to log the exception, what does it say?
– Alex Mamo
2 days ago
@AlexMamo Could not serialize object. Serializing Arrays is not supported, please use Lists instead (found in field 'sound')
– Citrin
2 days ago
So it's very clear, right? You should change the type from array to list.
– Alex Mamo
2 days ago
Thank you, I'll try it.
– Citrin
2 days ago
Ok and tell me if it works.
– Alex Mamo
2 days ago