Firebase Query Android Studio Tutorial 48 - firebase querying data in descending order

preview_player
Показать описание
In this video tutorial#48 we will be using query firebase database android studio to retrieve data in descending order that is to sort the data in descending order so that the new post appear at the top whenever a user updated status or new post. We will do that using query firebase. So you will also learn about how to sort data in descending order in firebase so that new post appear at the top.

For new Updates and information you can Follow me on:

android final year project ideas for computer science
android final year project ideas
android final year project
final year project software engineering
snapchat clone tutorial android
How To Build the Snapchat App
make an app like instagram
snapchat clone android
android studio instagram clone
snapchat clone app android
firebase blog app 2018
instagram clone android source code
make an app like snapchat
make an app like tinder
how to make an app like snapchat android
android instagram likes app
how to make app like facebook
snapchat clone android
android studio snapchat
final year project computer science
facebook clone android
final project computer science
facebook clone
social network like facebook
how to create social network like facebook
snapchat clone android studio
android blog app 2018
facebook clone android studio
how to make android app like facebook
how to make an app like snapchat android
how to make a social media app on android studio
how to make a snapchat clone
snapchat source code android
snapchat clone tutorial
facebook clone app
how to make social network like facebook
android final year project ideas for computer science 2017
android final year project ideas for computer science 2018
firebase social network app
snapchat clone android studio
twitter clone android studio
twitter clone
social networking android app
Android Social Network App
Рекомендации по теме
Комментарии
Автор

Fixed the issue of the proper order. This video works but sometimes a counter number gets duplicated or when you delete a post it messes the counter up. I figured a better way and so far is working perfectly, even when you delete a post. You need to store a timestamp and push that to Firebase. Instead of Query sortPostsInDecendingOrder =


I have a much better way. Do this in the HashMap:


postsMap.put("timestamp", getCurrentTimeStamp());


create the method above


private long getCurrentTimeStamp(){
Long timestamp =
return timestamp;
}


Then in the MainActivity in the DisplayAllUsers() method use:


Query sortPostsInDecendingOrder =



So far it works flawlessly. Even when I delete a post it doesn't break anything. Though I'd share.

ryanguitargodfrey
Автор

i raally like how you teach its very easy to understand

terencejumba
Автор

i have finish this part..thank you ..now i'm moving to part 49 .. great tutorial..

hendrawanarief
Автор

go east go west mohamad ali is the best ..this tut very usefull .. i mange to make pagination aftear i know how to get number of post ty alot

pcxzojc
Автор

Thanks Coding Cafe. I was really waiting for solving this kind of challenge.

atefmounir
Автор

you are a great man! Thank you for your efforts.

mustafacagal
Автор

After this solution, I realized that programming is thinking not typing.

KamranKhan-yyfu
Автор

Great Work, you have all my support 💪💪

_Regulartrader
Автор

Hi!!!! Yes this works great, except when you delete a post. The next time the same user makes a post after deleting one it's not on top. It's underneath the top post. How would I fix this?

ryanguitargodfrey
Автор

U r really awesome tq for this video😊😊 we support u

mukeshabhi
Автор

wassup everybody ....
if i post an image immediately after posting another image ... the second image replaces the first image ..
in order for the two images to be on the timeline ill have to wait about a minute after to unload the second one
somebody please help

Dahprofessor
Автор

if I get out from the activity then the count is set to 0 cause there is no change on the data on the database so the onDataChange is not called there for the Datasnapshot 's existence is not checking
what do I do? If I add several post then it's fine but as soon as I go outside of that activity the counter is set to 0 again
and the mail problem of all is my post are not in descending order.

imransefat
Автор

We also have an error .when ever we update our profile picture, the profile picture on posts was not updating it shows blank. So please fix that also

pavanrajaparvathaneni
Автор

is it possible to also do this on comments? how?

kentloves
Автор

Hey Ali, I'm using your tutorial to do a course work, many videos are missing to finish the tutorial?

Hicaro
Автор

Sir the postcout is added successful but it not showing on top

adityamore
Автор

ThankYou for this tutorial helped me alot but when i delete my existing post again order changes how i can resolve that ???

nileshtak
Автор

Hey Sir ...! I did it like you did but I got my app crashed. When I clicked add new post and uploaded it. It showed blank. And I log out and create new account. It sends me to MainActivity and alert Toast message "Profile does not exist!". Then I go to Profile and my app crashes.
I open my app again and go to Settings and my app crashes. I cannot find bugs so I keep going to next part until last video of your tutorials.
I complete it but my previous bugs still live. Could you help me, please ? I will send the source code.

badmanrko
Автор

Hello sir
in this app i face some big problem that if we edit our profile then it will edit in user section in fire-base db they can't edit posts section in firebase because the current_user_id not match in profile current_user_id therefor in this application we cant able to edit whole user information. Kindly sir give me the solution of this problem ..
Thankyou..

mudassarr
Автор

after posting 11+ post short is not working, please check this issue

bhushandhapodkar