Access Photo Album from iPhone Code - iphone

iPhone Apps like "Picture Map" access all the photos in my iPhone's camera album and display them without ever showing an Image Picker Control.
Does anyone know how this is done?
Thanks
G

This is an old thread but I will answer as I'm the one who wrote and published Picture Map !
Thomas is right, I was accessing the DCIM folder to parse each file (to get its location from the EXIF structure and to access thumbnails too).
As an application has no right to access files outside of its sandbox, Apple asked me to remove the application from the AppStore ... And anyway, since iOS 4.0, application are not able to access DCIM folder anymore !
I did rewrite the application to use ALAsset class and published it again under the name of "Picture-Map" ! The source code is also available here : https://github.com/sylverb/Picture-Map

I believe I know what's going on:
There are two separate photo collections on an iPhone:
The iPhoto album, which is synched from the iPhoto app on the Mac.
The pictures taken with the iPhone camera.
The iPhoto album is not accessible by normal apps (provided we're not talking about jailbroken devices here) - an app can only request that the user picks picture by picture by hand.
The pictures taken by the camera, however, end up in a "DCIM" folder which is shared between all applications, along with other data. You can see all that if you use the Mac application "iPhone Explorer" (I am sure there are similar apps for Windows as well).
Hence, while never having tried out "Picture Map" myself, I suspect that it simply accesses this DCIM folder.
...
Oh, now wait...
I just used iPhone Explorer to look at my iPad's shared folder (/var/mobile/Media) and see that there's not only the DCIM folder there but also a Photos folder, which contains a "Photo Database", just like on the Mac.
Wow, this is interesting...
This could mean that "Picture Map" actually reads this DB file directly. It's been done on the Mac, and I suspect that the file format on the iPhone OS isn't much different, either.
Does that answer your question?

Related

Is it possible to take screenshots globally on the iPhone and save it on an app?

I wondered if it is possible to take a screenshot on an iPhone (newest versions of iOS) gloablly (in any app) and save it on a specific app that manages the screenshots and saves them in specific folders instead of the default photo album.
I searched the App Store for such apps but couldn't find anything that suited my needs.
Thx.

Is it possible to download songs from app to itunes library

I've seen a lot of questions out there looking to play music from the user's library on the app, or to access iTunes from the app to download things, but I'm looking to do the opposite. I'm creating an app for a local band, and they are supplying 5 full length songs to include in the app, and I thought it would be a nice touch to include an option to download the songs from the app into the users iTunes library (at the request of the user of course). Is there a way to make this work?
Probably not. Apple doesn't want you in there, because you could have the ability to mess some things up. If you've ever used a ringtone app, they actually have you copy the ringtones onto your computer, and then reinsert them onto the device as a ringtone, because the app doesn't have access to the ringtone section, so you probably can't do that with songs. I know you don't want to hear this, but you're better off just putting the songs onto the iTunes Store and then putting a link in your app to the songs on iTunes.

iPhone "Share" button

Is there anything like the Android's "Share" button in iPhone?
I am just starting out in iOS development and do not have an iPhone (yet). The idea is to be able to select documents or images saved on the phone and use them in my app. I realize there is an ImagePickerController but that is not what I am looking for. I am also not looking for a third party component, rather something integrated into the OS similar to Android.
Short answer: No.
You can register your app to handle certain file types, and files of those types can then be opened by your app via UIActionSheets that may appear, for example, when you tap and hold on a file in an email. You can also transfer files to your app via iTunes. There's no 'file explorer' type feature in iOS where you can pull up a view of files saved to your phone.
For images, as you mentioned already, you must use UIImagePickerController.
From documentation
Sharing Files with the User
Applications that want to make user data files accessible can do so using application file sharing. File sharing enables the application to expose the contents of its /Documents directory to the user through iTunes. The user can then move files back and forth between the device and a desktop computer. This feature does not allow your application to share files with other applications on the same device, though. To share data and files between applications, you must the pasteboard or a document interaction controller object.
You can read more here:
https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StandardBehaviors/StandardBehaviors.html%23//apple_ref/doc/uid/TP40007072-CH4-SW7

Sharing files between iPhones and PC

Im looking to see how I can share / export content from my app to allow the content to be imported in the app running on another device.
Something like if you get emailed a pdf file or word file it opens in the correct app when tapped.
I tried using the iTunes sharing approach but that allowed full access to the apps documents folder which allowed the user to mess around with content they should not be allowed to!
The content in the app will be a bundled group of images, text and audio so could be large in size so was thinking of how to transfer easily from within the app to a PC of some file sharing service that would allow the target user to then select this content from within there app and have it imported available to use.
Is this a big ask?
The 1Password app uses DropBox and it seems to work quiet well.

Iphone app sharing file with iTunes problem

Somebody please help me out. This problem is killing me.
I went through tones of documents and posts. All seems to suggest that simply add a UIFileSharing key into info.plist and set boolean value to YES, files in App's Documents folder (not sub-folder, I know) will show up in iTunes.
However my problem is that I don't have an iPhone, so I really have no clue about what exactly the behaviors of both iPhone or iTunes will be when try to verify this file sharing thing. And what is the right way to verify this.
So when my client try to verify this off my watch (we are on different sides of earth), he keeps reporting back that file sharing feature not work. It is certain that file is properly stored under Documents folder.
In the last attempt, he claimed that he can see the app but not files.
I would like to know the following things, so I can guide him through this and end this pain:
Is it really plain and simple like add one key, no changes to code needed? Or did I miss something?
Are there any special requirements for building (like, only work for release build?), deploying?
What will really happen when plug the iPhone into the computer and sync with iTunes? Will the app show up in the Apps tab anyway, or only show up if file sharing feature are enabled correctly?
Thank you all.
Is it really plain and simple like add one key, no changes to code needed? Or did I miss something?
Yes
Are there any special requirements for building (like, only work for release build?), deploying?
No
What will really happen when plug the iPhone into the computer and sync with iTunes? Will the app show up in the Apps tab anyway, or only show up if file sharing feature are enabled correctly?
It will show up in the app view (on top) all the times. But you will only see them in the file sharing area if you have an app with enabled filesharing.
File sharing is only available on iPhone OS 4 onwards and iPad 3.2
Make sure your client has iOS4 or later.