Recent Friends

Joined
Oct 18, 2011
Messages
160
Reaction score
0
Points
16
Hi, i have built my first app which is just a very basic instant messaging app.

When you click the message button, it loads a screen with your recent friends (the last 5 people you sent a message to).

The Recent Friends list works by querying the database to see who are the last 5 people that you either sent a message to OR those who sent you a message.

I find the list sometimes takes a while to load, purely because it is querying the database for this list.

I'd like to change this feature so that it loads instantly from the iPhone memory instead of querying the database. Can anyone recommend a way to do this?

Thanks in advance for your help.
 
Joined
Feb 25, 2009
Messages
2,112
Reaction score
71
Points
48
Your Mac's Specs
Late 2013 rMBP, i7, 750m gpu, OSX versions 10.9.3, 10.10
When it queries the database, are you talking a mysql/postgres/other database online somewhere or through a sqlite database on the device?

If it's online, I'd probably suggest a few things:

1) For when a person writes or receives a message, update a list stored on the phone with that information. It's small enough (5 entries) that you could probably just store it in a plist file without too much difficulty.

2) Look at how your queries are being handled... It sounds like there is some serious latency either between the device and the server or in the server processing the query. You may want to investigate that to improve overall app performance.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
If you're looking to do local database work, sqlite is the way to go. It's simple, clean and takes most standard SQL queries. I use it here in a mobile app I'm developing to keep track of data and it works like a charm. I don't know what language and tools you're using but Apple provides sqlite support for its tools and languages as does Adobe/Apache Flex.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top