Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Can someone answer my question: Why i can't create child in root like this:
mDatabase.child("teams").child(uniqueIDstr).child("members").child(currentUser.getEmail()).setValue("XD");
because something like this is working properly:
mDatabase.child("users").child(currentUser.getUid()).child("groups").child(uniqueIDstr).setValue("group");
The problem is in this call child(currentUser.getEmail()). An email address always contains at least one . and that character is not allowed in keys in the Firebase Realtime Database. You should actually be getting an error message when you run that code that pretty explicitly tells you this.
The common solution is to "encode" the email address, for example by remove the .s from it or by changing each . to a ,. The latter is a neat trick, since , is not allowed in email addresses while it is allowed in Realtime Database keys.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 19 hours ago.
Improve this question
I was trying to use the default linked list provided in java, however, it seems like I can't use the method I created for the item in the using the linked list. This is very weird, it seems like I can only access the method if I have a concrete object, not when trying to implement method from a object that haven't been created yet.
this image below shows where I get the problem
enter image description here
However, I did implement a method in the Card class
enter image description here
This is very weird, cuz the method work on the individual object I created
enter image description here
Can't figure out why, is the default linked list in java just stupid?
I just can't get it working somehow
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
This is my collection:
What Im trying to do is to insert a new "departamento" using JAVA, but when I do it, it is created as a new object.
And this is what Im doing in java:
Any idea? Thank you.
Try this, there is a function called update that has two parameters first the query of the element you want to update, send some configuration to update using the operator $push
db.departamentos.update({"titulo": "nombre"}, { $push: { "departamento": {"ubicacion": "Barcelona", "nombre": "nombre2"}}})
Take a look from MongoShell
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
The problem is, User id enter randomly, or not enter in sequence like this:
problem description
The last entry is "bill" why is "Warren" shifted to number three? This shift makes my bar chart not sequential on the x Axis.
What I want is "Warren" to stay in second place and "bill" must be under the "Warren".
this is my code:
...
DatabaseReference reference = db.getReference("Attendance")
reference.child(uid).setValue(new CurrentAttandance(cA, userCount, xname));
any help thank you guys. :-)
The "random" user ID you're stating is not appearing automatically or it is not just any random bunch of String characters. It looks like the uid of the user.
Please add the code, but from the output I am guessing that you're adding your users in the database, with code that looks something like this:
ref.child(mAuth.getUid()).child("xname").setValue(name);
This is the reason that the Strings are appearing as the parent child in your Firebase database.
Also as #J.A.P correctly pointed in the comment, the order is according to the lexicographic nature of the parent Strings that are uid of the user in your database.
If you want them to be ordered according to order by which they sign up, then add a timestamp in your Firebase Database as sibling child of xname and show the list in order of your timestamp.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
Code fragment
I followed a video series of Derek Banas about java threads but applying the same code on my compiler it gave me an error. I dont know why.please help me out.
Another code fragment
note: I have already defined "getTheMail" with an integer.
This is not a threading issue. You should instantiate GetTheMail class without giving any constructor parameters since it is not expecting any.. like this : new GetTheMail(); I encourage you to read this article for further understanding : https://www.javaworld.com/article/2076204/core-java/understanding-constructors.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
Ok this is really frustrating. I'm using my API key perfectly fine. Authentication does just fine, token is generated fine, session key is also OK.
But when I run the playlist.create, the playlist is not created.
Addendum (6 April 2013): It turned out I had to generate a new md5 hash for my sig, but even after doing so, the method does not work.
Addendum 2 (9 April 2013): I started from almost scratch today, and redid most of my code. I created 16 playlists successfully, no errors. But today, the same code's not working. I didn't touch it at all and yet the error.
nvm
For security purposes, I cannot show you my security keys. However, I did write a quick program to find the last.fm session key: http://github.com/thekarangoel/LastFMSessionKeyFinder Simply register at last.fm/api, enter your API key and secret in the program and you'll have everything you need to test the API call.
My gazillionth answer
You did not include the description in your hashed signature.
My second answer
As mentioned before in one of my comments, you're code is causing a MalformedURLException. You don't see this because you're doing no exception handling within your SwingWorker subclass. If you add exception handling as suggested here, you'll see that.
My first answer
You're missing an & in your parameter list:
String params = "method=playlist.create&title=" + title+ "api_key=" + ...
Should be
String params = "method=playlist.create&title=" + title+ "&api_key=" + ...
It's probably a good idea to read the answer of the request (connection.getInputStream() etc.) and check what the issue is.