Android Question Get list of last sms message from all conversations

Discussion in 'Android Questions' started by Juan Marrero, Mar 9, 2015.

  1. Juan Marrero

    Juan Marrero Active Member Licensed User

    Is there an easy and faster way to retrieve the last message from each sms conversation? I'm developing a SMS app and i found a way to get what i need but it takes like a minute to load. What i did was to retrieve all messages and run through all messages in a loop an detect the last message of a thread based on date and time of the messages and place them in buttons created on the fly based on number of sms conversations. It takes a while to load if you have a lot of sms stored.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can't you fetch all the messages from the last month instead of all the device messages?
     
  3. Juan Marrero

    Juan Marrero Active Member Licensed User

    Yes, but what if i have locked messages from last year? (which is my case) i won't be able to load them.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    That's true. However for that you will need to read all the messages.
     
  5. Troberg

    Troberg Well-Known Member Licensed User

    Read all the messages the first time, then just "listen in" as they arrive and cache the latest in your own file?
     
  6. Juan Marrero

    Juan Marrero Active Member Licensed User

    Troberg, that seems a nice workaround, will try it.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice