iPhone "Share" button - iphone

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

Related

Can an iphone app add music to itunes?

Is it possible for an iphone app to directly add content to itunes, either directly on the phone, or by automatically (i.e. no user actions required) syncing when the iphone is connected to a computer?
If not, what is the fall back? One suggestion what was made to me is that the user can drag and drop files from the apps' Documents folder into the Music folder.
Thanks
Unfortunately, there's no way to do that without using private APIs. I'd enable UIFileSharing and let the user email the audio file, so they may add it manually.

Transfer file from Mac/PC to iPhone App Document folder

I want to transfer file from system (mac/Pc), which is present on my iPhone wifi network, to the document folder of my iPhone App.The scenario of my App is this, it will browse the system which are present in it's network. select any file(such as .pdf or ,docx) from that system(mac/Pc), copy it into the document folder of the APP and than use it with in the APP.During my search i come across the link iPhone : Transfer of files from Mac/Pc to app i have not found the detail instruction document, how to use it. Is Apple support any API or farm work to do this ? Please guide me
This is called iTunes file sharing. In the most simple way, you simply set the UIFileSharingEnabled key in your Info.plist file to YES. See for example this tutorial.
Rewriting itunes is not a simple task but I recommend you a clever and easier solution:
Implement a simple webserver on your iOS app. Write a windows application which will connect to your iOS app through wifi network. Then transfer the necessary files this way: you will send a file to you app, then your app should save it in documents directory.

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 transferring files using iTunes, but not allowing user to see all of docs directory?

It doesn't sound like this is possible, but I will ask anyway.
In my app, I store a lot of images and plists in the documents directory.
I would like to implement a PDF reader in the app that allows users to load their PDFs into the app via iTunes. I do not want the user to be able to see/access the contents of the documents directory since they could cause the app to perform unexpectedly if they messed with these files.
Is this possible, or is it possible to place my plists and images somewhere else?
You'll need to be registered with Apple to see this, but this page should give you the information you need.
You'll need to add a UIFileSharingEnabled key to Info.plist. This will give the user access to the Documents directory of the app, and let them remove or add files.
This tutorial gives an example of how to set up PDF support in an iPad app.

Access Photo Album from iPhone Code

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?