How can i store audio file in sqlite..? - iphone

I want to save recorded file and after that i want to save in sqlite database. How it possible?
Give me some proper guideline on that..
Ayn suggestion welcomes...

Instead of storing audio file data inside SQLITE, save the files into your file-system (like inside Documents directory) & save the file names into your SQLITE database. Refer to this SO question - Upload video into SQLite

Related

Restkit seed core-data with objects from a local file on launch

I'm working on an app, in which I need to seed core-data with some local data stored in a file and I'm using Restkit.
Right now, I have stored the data in JSON format in a text file, and on launch I use the "RKManagedObjectImporter" to map the JSON to objects. Since the data is huge, it takes a lot of time (at least 30 seconds) just to map the data from JSON to Core-data objects.
I obviously cannot make the user wait 30 seconds on the first launch, and the data is required as soon as the app launches. So what alternative do I have here ? Is there a way to create mapped objects and store them in a file ?
Any help will be appreciated!
You can create a Core Data .sqlite file and distribute it with the app instead of a JSON file. Then, when the app launches you can check if the user has an existing store file and, if not, copy the default file from the bundle into the desired location.
RestKit also offers importing support using a .sqlite source file, see here.

Valid file types for iCloud?

I find many similar question but i didn't get solution for this.
Is it possible to upload some file like image, document, zip file to upload on iCloud programmatically?
See table 4-1 in the documentation:
How do you manage the data? Manage files and directores using the
NSFileManager class. Open, close, read, and write files using standard
file system routines.
So if you can create a file, you can store it in iCloud. But remember there's a finite, relatively small amount of space available.
iCloud can handle all kinds of files. So if you want rot use an obscure file format or invent your own, go for it. It only can to be converted into a byte stream/NSData, but then again, what isn't?
Check this tutorial walkthrough app. It shows how to create, modify and delete files for iCloud.
http://github.com/lichtschlag/iCloudPlayground

Where is the SQL persistent store created by CoreData?

Can someone help me find where CoreData is storing the SQL file it creates in iOS applications?
So far I've tried "Show package contents" on the .xcdatamodel file and also the .xcodeproj file...No dice!
Is there an editor for looking at the contents of these SQL files?
Cheers.
-A
The url parameter of [NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:url:options:error] specifies the location of the file. Find this call in your code and see where you've stored it. XCode templates will put it into the top of your application documents directory, but you can put it anywhere you like.
Note that Apple considers the contents of this database to be opaque and non-user-modifiable. Playing with the data in your store is likely to cause issues with Core Data.
It's typically saved into your application's documents directory, with the name of your data model.
So, for example, if my data model is called AppData.xcdatamodeld, it will be AppData.sqlite inside my app's document directory. You shouldn't really need to touch the .sqlite file though.
Hope that helps!
Core Data editor --> http://christian-kienle.de/CoreDataEditor/

how to store files into sqlite

I m creating document files using filemanager which is text file.i want to store this files into sqlite tables?How can i store from iphone and what data types can be used?
Thank u..
Assuming your app is linked to a sqlite library, just create a database and then add tables and data. I'm not really clear where you're getting hung up.

Importing huge music files into database

We have very huge music files in mp3 formats (very huge more than 1,000,000) and would like to import all these songs into the DB of an application we are developing. Is there any easy method to import such huge files at once. Kindly let me know
Why not just use a filesystem for them - that's what file systems are designed for? Index the filenames in a normalised DB.
Yes, there is
Take a look at how has Apple solved that problem. Go to the iTunes_control folder on the iPod. You'll see that there's a Music sub folder with dozens of folders named f00, f01, ... f50 (50 is arbitrarily big number). Every file has been renamed to a filename that looks like a hash value.
Use the file system to store the files. In the database store the path to the file on the file system together with the mp3 metadata information (artist, name, album, composer, etc) and provide search capabilities over it.
You don't want to store music into the database. Store some kind of URLs to music into the database, with all the metadata you want to keep, and store music into folders on various servers. I am author of radio automation software that used this scheme and we never looked back at our decision.
Main reason for that is that you don't want anyone to be dependent on some database API to extract the music.