tags:

views:

886

answers:

6

Hi Folks,

Our lovely app that downloads mp3s from our server into a local file on the phone then plays from that file was rejected for using too much bandwidth.

I understand the rejection (we are downloading rather than streaming) and don't quibble with their decision... our first priority was quality of user experience.

I am just wondering... what do I do now?

There are no hard and fast rules... Apple just says, "Must not in Apple's reasonable judgment excessively use or unduly burden network capacity or bandwidth".

Anyone have data on what Apple considers reasonable data transfer rates?

Should I fill up the buffer file in short spurts? Should stream the file at a constant rate (and how would I limit the transfer rate from within the app?)

Any and all suggestions are welcome.

Thanks

+8  A: 
Spence
A: 

On a more serious note, what is it trying to do? There are many markets for iPhone outside of the US which don't have good download rates for phones, nor are the download cap sizes good, so having an app do lots of downloading isn't a good thing.

Could you possibly drop the data rate on your mp3 or some such? Make it optional to do the downloading with a warning that it will use your download?

Spence
I agree that we should have been more mindful of the bandwidth issue... but seeing that youTube, Pandora and a host of other streaming apps get buy with it I just didn't consider we would be rejected because if it. It is true.. if every developer overwhelms the network... using other services like web browsing will suffer. That's why I'm looking for a responsible way to do this and still give the user a good experience.
Michael
+6  A: 

Have you considered HTTP Live Streaming? It's built into OS 3.0.

Basically, you split your media into small (say, 10 second) snippets and put it on a standard web-server. Then you create little text 'meta-descriptor' files in EXTM3U format that point out where the bits are. The interesting thing is that you can create multiple versions of each snippet at different bit-rates. So if your bandwidth is good, the iPhone player dynamically chooses the higher bit-rates but when it's low it automatically switches to the lower bit-rate version of the snippet. It does this on-the-fly to adapt to changing conditions.

So if you split your MP3 into multiple 10-second bits at say, 3 different bit-rates then when the user is connected through WiFi they get the high-quality stuff but if they're on 3G or EDGE they get progressively lower-quality (and smaller sized) content.

If this violates your downloadable media concept, then perhaps you can use the same trick and keep multiple size files for each connection type. Then if you're on WiFi (or get a fast turnaround on a heartbeat ping to the server) download the big file vs. medium or small size ones.

Here's a decent step-by-step on segmenting content. They focus on video but it should work with audio content as well.

Ramin
Your first suggestion to segment the files seems like a lot of work but perhaps that will be the way we have to go. The files are about 30 minutes long so that would be 180 files each. We play the files in our own player without the user leaving the app .. would that still be an option with 3.0 HTTP Live Streaming?It would be so much easier of Apple gave developers some benchmark.
Michael
Step downs of content quality sounds like a brilliant idea as you move from wifi to 3g to gprs...
Spence
The tools listed in that article I linked to automatically do the segmenting and playlist creation for you. So far I've only played with video files but audio is supposed to work too. The streaming client is essentially the embeddable video player. When it comes to video content it goes full-screen but is still embedded (i.e. you don't exit your app during playback). Since it's an officially sanctioned framework you may have better luck getting your app through.
Ramin
That's a good point. The issue I have with their player is that it is, simply put, ugly when playing audio.
Michael
I was given a suggestion via another source that I think we might go with ... that is "run the download in a separate thread and block the thread when data per second limit is reached". We are going to try that and limit the total usage to under 5mb per 10 min, the only figure I've seen tossed around as a limit.
Michael
(the files are encoded at a max of 64kbs)
Michael
A: 

YOu could not download the mp3 unless you are on wireless, and inform them of that. If you the mp3 are too important, then just tell them it only works on wireless, or include a few mp3 on the device. But 30min of mp3 is ridiculous, that is about what, 30meg.... think about it, 30 meg is just too much.

The files, which are the core of the app, range is size from 5Mb to 16.7Mb. Which is not ridiculous.
Michael
+6  A: 

I have talked with Apple Developer support, and just FYI. You are only allowed to stream 1 MB per minute over the Cellular network. Support suggest that you test your app in the following way:

"The basic measurement methodology is to turn off all background updating (particularly Mail's automatic mail downloads and Calendar updates), reset the transfer statistics in "Settings:General:Usage:", and then launch your application. Let it run for a fixed amount of time (five minutes is reasonable), and then exit your application. Once you've finished the test, the numbers listed under "Cellular Network Data" in "Settings:General:Usage:" are what you should focus on reducing.

Using what I just described, I'd suggest 4.8 MB every 5 minutes as the guideline you use to ensure your application stays within our bandwidth requirements."

Hope that helps at least a little.

postalservice14
This is the most helpful answer yet... Thanks. We are now hitting exactly 4.8 mb per 5 minutes (coincidently).
Michael
+1  A: 

I would suggest throttling the bandwidth on the network/http request when connected to cellular, and having no throttle on wifi.

A combo of using Reachability to detect the network status, and implementing your http request using CFNetwork with a sleep until the next second whenever you have already downloaded as much as allowed per second should get you there.

You should check out this project, either to use, or just to see an example of how to code this well:

http://allseeing-i.com/ASIHTTPRequest

The ASIHTTPRequest class implements this, using either the old or 2.0 version of Reachability, and also provides a class level throttle, so even if you have multiple concurrent downloads and uploads, so long as all of them go through ASIHTTPRequest, they will be properly taken together and throttled properly.

A bit more on how to use this here: http://allseeing-i.com/ASIHTTPRequest/How-to-use#bandwidth_throttling

Lots of good stuff in this (and no, I am not the author of any of it).

Andrew Kuklewicz
I ended up doing just that. But I've increased the data transfer rate on subsequent updates without being penalized (so far)
Michael
Very interesting. We got through the review with the throttle added as well - I'll have to see about creeping up the throttle limit...
Andrew Kuklewicz