Set artwork for music file in iOS iTunes Library (Jailbreak) - ios

There is a good open-source library that uses Apple's private frameworks to add audio file to the iTunes library on a jailbroken iOS device, libipodimport. What it's missing is the ability to also add artwork when adding a music file (one contributor checked in code that should do this, but the author later removed it as it didn't work).
Does anyone know what was missing from the code in libipodimport (see previous link), or perhaps an alternative way of adding artwork files to a music file?

The contributor to libipodimport told me the missing line that made the artwork adding work:
// metad is a SSDownloadMetadata object, see libipodimport for rest of code
[metad setFullSizeImageURL:[NSURL fileURLWithPath:[userInfo objectForKey:kIPIKeyArtworkPath]]];
It seems to only work with jpeg files, not png files.
The library libipodimport will most likely be updated by the author in the near future.

Related

Pre-load content into Documents or Library directories from XCode

I am building an iPhone app that requires preloaded content. This content is presented so that it tests the user's knowledge, but is not modified by the user. The content consists of proprietary image files and pdf files.
From what I understand, the best practice would be to store this in the app's Library or Documents directories (please inform if this assumption is not correct). In a future version of the app I might want to upload additional (not replacement) content via API, but this is not part of the initial version.
I have seen many posts and tutorials regarding obtaining paths to the Documents and Library directories of an app, and reading/writing to them. This is all good and useful, but not what I am looking for here.
I would like to preload the content into the Documents and/or Library directories, for the simulator initially, to test app in simulator; and ultimately to the release version. I would have thought this would be possible to do from XCode without writing code.
I have not been able to find a solution to this on Stack Overflow or other places on the net. Any pointers, links, solutions are welcome. I am using XCode 10.3 with Swift 4.2.
See the File System Programming Guide: File System Basics, which shows us:
The “data container” (including the Documents and the various Library folders) is for content generated/saved by the app. When, in Xcode, you mark resources as being part of the target, that becomes part of the bundle, and your app can retrieve it from there at runtime.
Theoretically, yes, you could copy data from the bundle to the Documents and/or Library folders, but, yes, you would have do that programmatically. It seems a bit wasteful to have two copies of these resources on the device, but you can do whatever you want. Generally, though, resources included in the bundle would just be be opened directly from there at runtime, not copying it to the data container (except for those cases where you would need to change it, because bundle contents are read-only).
FYI, for additional information regarding the file system, see the iOS Storage Best Practices video.

Qt for iOS development: File read and write

I'm using Qt5.5 for iOS development.
I'm wondering how to find and open a file in an iOS device to read and write using Qt5.5. As I know, there's no such file tree structure in iOS. When I download a picture, for example, I even do not know where it locates. But I can see it in apps.
Is there anyone can help? Thanks very much.
I am no expert with Qt, but I believe you need the QStandardPaths class.
iOS is no different to any other platform that stores files in certain pre-defined locations.

Dynamically including Subtitles to video files in iOS?

In AVFoundation we can split and merge tracks of any media files. I assume a subtitle to be another track and I want to include this track based on the language the user chooses. My Idea is to include the hardcoded subtitles files as per languages I support in the project and add this subtitle track to the video file I have at run time.
I am not sure if this is possible with AVFoundation. Please direct me to a solution.
The apple provided example code "avsubtitleswriterOSX" is compatible with iOS 7 and 8. This solved my issue.
avsubtitleswriterOSX

Write metadata to mp3 local file

I´m reading metadata from mp3 file, by this way iOS AVFoundation: How do I fetch artwork from an mp3 file? and works perfectly.
when the file is mp3 and doesn´t have artwork, or title, i'm getting NULL values.
I need, when the file haven't metadata like artwork or title, to write my own metadata in the mp3 file, put my own artwork and my own title.
How i can write metadata in mp3 local files on iOS7?
Thanks in advance.
Well as no one answered.
I found the solution, I including this library in the project: https://github.com/rjyo/libid3-ios, which allows you to edit the ID3 tags of any mp3 file.
Some modifications I had to do to make it work properly with xCode5 and iOS7.
Instead - Step 4 (Quick Start (Xcode 4) repo instructions):
Add the following to Link Binary With Libraries list
libiconv.2.4.0.dylib
Libstdc++.6.0.9.dylib
libz.1.2.5.dylib
libid3.a
Once you've successfully added the libid3-ios libraries in your project, read this question iOS use ID3Lib to edit ID3 tags from mp3 files in the NSDocsDir, for understand the libid3 API faster.
Remember you should use .mm extension instead of .m for objective-c containing c++ code.

Phonegap iOS: Download image to Photo Library

Is it possible to download a file (image) and save it in the Photo Library?
I am aware of this download method, but it only allows to download to a location that I specify.
On iOS I was unable to get the path to the Photo Library (and I know it doesn't just store it there, but also adds it to a DB)
Does phonegap provide this ability in some way?
Do I need to write a dedicated plugin for this?
Thanks,
Nadav
Ehh... I hate answering my own questions
I found this was impossible without a Phonegap plugin, and couldn't find one that does that,
so I wrote one.
Currently only iOS and Android are supported.
https://github.com/grnadav/SaveToPhotoAlbumPhonegapPlugin
Feel free to expand it's functionality and pull-request :)

Resources