Question

Hey guys, I want to store a categorized list of URLs. This is an internet radio streaming app, and so I want to have at least three links for each genre:

  • the free streaming URL with commercials
  • the premium streaming URL at 128 kbps
  • the premium streaming URL at 256 kbps

So every genre will have these three URLs.

For the premium streams, there are also 'geo-localized' streaming URLs, or 'mirrors', for specific global areas. For example if I am in the United States, I can choose a closest location of the available mirrors for potentially better streaming quality/reliability.

These URLs can, though I doubt often, change, and so I will want to be able to update them, meaning the storage can't be read only. I don't know exactly how I should store the information, let alone in what type of storage: sqlite db, XML, or property lists. I'm new to all of this so I'm sorry if any of those is stupid for this situation, heh.

As for the structure, I'm not sure how to accomplish that either. I can possibly have separate files/databases, whatever I end up using, for each location, or I could have one big one that is something like:

  • Rock
    • Los Angeles
      • Free stream
      • Premium Stream - 128kbps
      • Premium Stream - 256kbps

But I figure the database/file would quickly become huge.

I guess I can also have separate files/databases for the free and premium streams, given that premium users most likely will only want to listen to premium streams (But still have the option of the 128kbps or 256kbps stream, depending on their network reliability). I could then have an option in the settings as to which streams to show; free or premium. This should cut down on the size.

I later want to present these URLs in a table view and navigation controller. The root view will be the list of the genres, and by drilling down into each genre it will show the free or premium streams. The location (such as Los Angeles) will be chosen in the settings, and will not appear in the table view.

I would appreciate your guys' suggestions. I tried to be as clear and specific as I could, sorry if I missed anything. I'm not asking for code, just what your ideas and suggestions are on how to design this persistent data store, and in what to store it, given that I'm new to this.

Thanks!

Was it helpful?

Solution

If I understand you, you want:

A list of genres, each containing a list of locations, each containing a list of qualities, each containing either a set of data (including URL) or just a URL. Either way, you can do this as a property list, and its just getting the the borderline of where you want to be with a property list as opposed to a database.

SQLite is on the iPhone, accessed by the standard C function API, although Core Data is not. SQLite would certainly allow you a lot more structure to your database and your queries.

Either way, you could include some sort of seed ID for the database, and then query an online server to receive just differences and that would reduce the need for transfering a large database over the net - but you'll need to determine just how large your database is before deciding on whether that is worthwhile. Simply compressing the XML file might be all that is needed, since the XML would compress a large amount (probably to ~ 30% of its original size).

Alternatively, you probably only really ned the area-appropriate sections of your database.

OTHER TIPS

Something else to consider is that for compatibility with pre OS 3.0 devices, Core Data (SQLite) isn't really an option.

Besides Core Data's (un)availability, I'm not sure that the data you need to store maps cleanly onto a relational data model. I'd lean towards the plist storage. I think it makes the most sense given your needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top