I'm making a video decoder application on Xcode 4.2. When I click on a button I need the file explorer to open so that I can choose the appropriate file to decode.
How do I give this file explorer option in my app?
There no such thing like file explorer in iOS .So you cant browse through the files in the iOS .At the most you can access the camera roll . Apple doesnt allow to access the other things like songs,other file etc
Related
For debugging purposes I want to accept a JSON file from the Mac via drag & drop in the iPad simulator.
I implemented UIDropInteractionDelegate and can successfully accept drops from the iPad Files app. But ideally I'd like to accept drops directly from the Mac.
Right now, when dragging a JSON file into the Simulator, the Files app is opened and handles the drop.
I doubt it's possible but if someone has any idea (even private API, since it's for debugging only), please let me know.
You can accept dropped files in the iOS Simulator by configuring your app to open documents of type you want to import. You can do this via CFBundleDocumentTypes in your Info.plist, or by using the Info tab in your target's build settings. The UTI for JSON files should be public.json.
When you've configured your app to handle JSON files, simply implement application:openURL:options: in your app delegate to actually handle the drop.
I was developing an ios application for file backup. In that I need to list and enable user to pick up files from any folder and need to do email backup like media and image picker.
I am struckup here with a bottle neck. I can't triger populating the list of document and email list for the user to pick. I had tried many codes, but it is not working.
I was working with the simulator.
Could anyone share their insight?
Regards
You should be more precise : do you want to pick up any file from any application on your device or just in your application library folder ? You can't access others applications folders.
You can find more information about the file system here :
https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html
iPhone do not have a file browser.
The only place that a iPhone app can take file is from photo album.
Every application keeps its files in its private place.
I am developping a mobile application using Cordova. This application allows users to navigate in a kind of a file manager and allows them to download files. I use the plugin "FileTransfer" to download the file on the user's device and then call the InAppBrowser (version 0.5.2) plugin in order to open it.
While it works really great under Android, I can't say the same under iOS (tested under versions 7 and 8).
This is the line of code I use to open the downloaded file:
window.open(entry.toURL(), "_system");
Under Android, it proposes the user which application he wants to launch to open the file or launches automatically the default application based on the file extension. Under iOS, the file is downloaded and then nothing happens. I have found out I could use the integrated viewer of the InAppBrowser plugin when the user is under iOS. I do that in this way:
if (navigator.userAgent.match(/iPhone|iPod|iPad/))
window.open(entry.toURL(), "_blank");
else
window.open(entry.toURL(), "_system");
With these lines of codes, if the user is under iOS, the integrated viewer is launched and displays the file. The problem is for ZIP files or other files that can't be rendered in the viewer. This one says "Load Error".
I think that if "_system" worked, Safari would be launched and would propose the user how he wants to open the file.
Does anybody have an idea of how I can make "_system" worked in iOS? Is this eventually a known problem (I couldn't find anything related to my problem)?
If this can be relevant to my problem, I use Phonegap Build in order to generate the .ipa file.
On iOS when you use _system, it try to open the url you pass with safari.
As iOS have sandbox access limitations, safari can't open the url because it's inside your app sandbox.
You can try this plugin, it provides an "open with" dialog that will show you the apps that support the type of file you want to open if any available.
https://build.phonegap.com/plugins/1076
I have an app that downloads files that need to be edited and submitted back to the server through the app. These files could be anything, but are most likely to be .docs. I want to be able to open and edit these files in another app on the device, such as a .doc editor.
I've been able to get this functionality to work in similar Android and Chrome apps, but I'm very new to iOS so I'm not sure what my options are.
Is there a way to give permission for another app to edit a file that is in my app's sandbox? If not, is there a way to get the file back for submittal (like finding it through a file explorer launched through my app - similar to an 'Open..." file explorer dialog used in Windows/Mac OS/Chrome)? Am I going to have to create a way for the editor app to share the edited file back to my app?
Thanks in advance for your help!
To manage the file and the paths take a look at the documentation for NSFileManager:
https://developer.apple.com/LIBRARY/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html
I usually write using NSFileHandle for reading and writing:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/Reference/Reference.html
Hope this helps.
iOS8 will provide methods to allow apps to co-operate with "extensions".
See "Creating Extensions for iOS and OS X, Part 1 & 2` in the WWDC14 videos.
Also see the Apple "App Extension Programming Guide".
I ended up sending the file to a 3rd party app for editing and then sending the file back from the 3rd app to my app.
I have a client database iPad/Iphone iOS application running OK. I wish to be able to easily update the data associated with the application and the ideal solution would be to read from a text file on my PC when I am connected to iTunes on my (Windows XP) PC.
Can my iPhone/iPad app open a file on my PC when connected to iTunes? I can't get a file path specification that will work (allow me to open a file on my PC).
I have also investigated the iTunes FILE SHARING facility, requires a manual modification to the application .PLIST file to turn this on. Since whenever I rebuild and "Export to XCode" my application a new .PLIST file is generated I have to manualy edit it each time to get the file sharing changes made so this seems to not be the answer.
Alternatively packaging the file with the iOS application would be workable. I get some sort of application checksum error if I drop the data file into the xCode application.. not sure why. I understood this was the mechanism to get the data file packaged with the project. Maybe I am dropping the data file in the wrong place...
Any help/suggestions would be appreciated.
Looks like the menu item Deployment under the Project drop down menu in XE2 does the job. Allows files, images etc to be packaged up with the application.