views:

66

answers:

3

Hi Folks,

I am developing an application for android phone, In this I need to use at least 400 audio file which can be played for some respective texts, Now my question is which is the optimized way to do this.. One solution is putting all the audio files in the resource folder and referring from there, this will never be a feasible solution as the application size will increase. Is there any way to convert the audio file into some format and dump into the SQLite database and retrieve flexibly.

Any suggestions or guidance is highly appreciated.

Thanks in advance.

Vinayak

A: 

What is the motivation behind storing the files in the sql lite db? I dont see much benefit to that over storing the file path in the db, and the actual file on the file system...

Ben
Hi Ben, Thanks for your reply. If I store my files into asset folder the my application size increases, Is that the feasible solution. please comment on this. or is there any way to store the audio file in a low consumption format.
Vinayak.B
yes but storing it in the db wont save you any space...
Ben
A: 

Hi,

Anybody correct me if I'm wrong, but SQLite has an restriction of total row size < 1024kb. If all of your audio files are small enough, you could store them as BLOBs.

ognian
A: 

Storing the files as BLOB in a SQLite db will not save you any space vs storing them as files. If these files are not meant to be associated to any dynamic data, I would just put them in assets folders, that way they'll be compiled into the APK and might be a tad faster to retrieve that if they were in a db.

Ricardo Villamil
Hi Ricardo, Thanks for your reply. If I store my files into asset folder then my application size increases, Is that the feasible solution. please comment on this. or is there any way to store the audio file in a low consumption format??
Vinayak.B
If you store your files in your DB your app size will increase as well, I don't see how you could get away with including more bytes without increasing the size...You could try zipping them but you wouldn't gain much since music files are already highly compressed...
Ricardo Villamil