Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

134iPhone

macrumors newbie
Original poster
Apr 30, 2008
2
0
Hi guys,

I'm newbie about iPhone and SQLite. The basic idea of my application is discovering all the available MediaServers on the local network via Wi-Fi, displaying all the available multimedia files on the chosen server, and finally plays the chosen multimedia file. It's based on UPnP.

Ideally, this application should be quite iPoddish, thus I want to follow the list-style (Playlists/ Artists/ Song /Videos …) of iPod, but not to bother the users with the click-click-click traditional directories.

So my questions are :

What does iPhone do to form these lists? Does it use the SQLite to store the multimedia files and retrieve their descriptions on SQL query to form a required list?

Since my application aims mainly at the remote multimedia resources, should I get the description of each file stored on the MediaServer at the beginning and store all of them in the SQLite database on iPhone so that the different lists could be formed from them?

Could someone be so kind to answer these questions? Thanks a lot.:)
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
If you are streaming from a media server, your data should come from the media server.

However, it is also a good idea to cache that data (not the media itself, per se) if you have already gotten it, since it can save a lot of network traffic if done correctly.

What I would do is copy data from the server into a cache DB for that server. However, each 'block' of data should only be grabbed and cached if the user asks for it via the UI in the first place. Don't get too grabby with the server if the user never navigates the playlist, for example.

Now, to detect changes, you can use hashes. Hash the contents of a playlist (the titles, etc). Now, when you have a cache and want to see if it changed, you just ask the server to compare the hash you have with the one it has. You might not be able to do this if you are using a UPnP AV server though.

It can be fairly complicated, but good luck.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.