Can i save an image to the native Photos directory on an Ipad? - ios

I've got my camera saving images fine to the app path, but my client wants to be able to access the photos from the photos directory (the path that images appear in when you use the native camera apps on the ipad)... I seem to get a "File I/O Error" if i try to save to the "///var/mobile/Media/Photos/" directory, which seems to be the location... is it possible? or is there no security or something involved with that?

I've never used it, but you want to use the CameraRoll class. It should do what you want, and seems straight forward to use based on it's simple/short API.
Here's an Adobe cookbook example that uses the CameraUI class as well.

Related

Is there a way to pick *.HEIC files from an ios device in Flutter using Image_Picker or similar plugins from pub.dev?

i'm developing an App where I can upload images/photos from my phone photo gallery (ios device) to firebase.
Since I want to upload the images/photos in original format (e.g. *.HEIC for pictures taken by an iPhone) I need a plugin which allows me to do that.
Following plugin's I've tried so far:
wechat_assets_picker: this one does what I want to have and returns me a temporary path which contains the the picked image in it's original format (e.g.: /anyPath/tmp/IMG_0024.HEIC). But since I don't really like the UI of wechat_assets_picker, I would like to have sth. else. Maybe more native looking
image_picker: returns a path where the picture is converterd to *.jpeg (e.g.: /anyPath/image_picker_randomNumber.jpg). This is not what I want!
images_picker: same as image_picker... converts the image to *.jpg
image_pickers: similar to wechat_assets_picker but it does what I want. But I don't like the UI either
likk_picker: same - not what I'm looking for
file_picker: same - returns *.jpg
I'm getting tired trying all the plugins.
Is there anyone who can support? Maybe any other way how to pick an image from my gallery in it's original format and quality?
Thanks!
Given the fact that other plugins usually compress HEICs when picking, I would suggest you consider the below solutions:
wechat_assets_picker allows you to build your widgets using delegations. By override build delegates, you can customize each part or the whole part of the interface.
wechat_assets_picker depends on the underlying plugin photo_manager which allows you to build your widgets from the bottom on your own.

WKWebView File System Browser

I've been asked to add a file browser to an existing Objective C application that uses a WKWebView to load up a Javascript internal app.
Currently we have the capability of looking at the pictures on device to upload images into the app, but I've now been asked to do the same with more generic file types, specifically PDFs.
What I've read so far is that this is only possible if a file is stored in a specific part of the file system and only if the app knows exactly where the file is to begin with, but what I need is the capability to browse to a certain degree.
What I'd like to know is whether this is possible and if there is a good place to start on that?
Thanks.

How to embed images and sounds in an iPhone app?

I am having a real hard time understanding how to embed many images and sounds in an iPhone app. When I say embed, I mean I want the images and sounds to be downloaded with the app, and some of those images will appear when the app is run. Other images are just saved in the app's disk space, so that when a user presses a button, the image or sound will be accessed and displayed or played.
I have read tutorials on using 'core data' and such, but that only seems like a way to create objects that can be used to reference such data items, or for storing small files as binary data. Can someone please tell me how in xcode I can specify a directory of images and .mp3s to be loaded onto a phone with my app, and how I can then call those media with code?
Some example code for the following would completely solve my problem:
An app is loaded onto a phone, and it contains 3 buttons. If the user presses button #1, a sound is heard. Button #2 plays a different sound, and button #3 changes a UIImageView to a different picture. (this isn't a homework assignment or something, but if I could code this example, I could do everything I need to in my app and understand the process)
Thanks!
I mean I want the images and sounds to be downloaded with the app
Simply add the images and sounds to your project. Make sure you specify (in the Add Files to Project dialog) that they are to copied into the project and that they are to be part of the target. The result will be that the images and sounds will be built into your app (in what is called its bundle, in particular the main bundle - see the NSBundle docs). You can then fetch them out, as needed, in code. For example, to fetch an image, use imageNamed:. To refer to a sound, refer to the file as a resource within the main bundle.
Other images are just saved in the app's disk space
That is a completely different matter. You will have to get the images from somewhere while the app runs. There is no way to have the user download the app and the image end up in the app's disk space: the app must populate its disk space, in real time, as the app runs. At the time the user downloads the app, the associated disk space, outside the app bundle itself, will be empty.
For images, see the responses to this question.
Sound is similar to images, but is loaded differently, this tutorial show how to load and play sounds.
For files that are saved after the app is installed, you will need to download and save those files in your code. For starters, see Apple's guide to the iOS file system

IsolatedStorage on Mono for Android

Where exactly is the IsolatedStorage on the android devices. I would have expected it to be in the /mnt/sdcard/Android/data/[packagename]/ location, but it is not. I used the File Explorer (from eclipse) to try and find it, but I can't.
If I can somehow load a html page into the WebView or play a video from IsolatedStorage, then I won't need this actual path. But, I don't want to copy the movie to a temporary location in order to play it, I might as well just store it on the SD Card.
The reason I am using IsolatedStorage is to minimize the custom code across the platforms, I am developing for the Windows Phone, which only allows for IsolatedStorage.
To determine the directory in which your "isolated storage" aka internal storage is kept, use the GetFilesDir() method. This method is part of the Activity base class. It is to be used for files you do not want other applications to have access to.
Other useful methods
GetFilesDir():
Gets the absolute path to the filesystem directory where your internal files are saved.
GetDir():
Creates (or opens an existing) directory within your internal storage space.
DeleteFile():
Deletes a file saved on the internal storage.
FileList():
Returns an array of files currently saved by your application.
See the android developers documentation for more details
I found that IsolatedStorageFile points towards internal memory only.
I used the Context.GetFilesDir() and the Context.GetExternalFilesDir() depending on the user's selection.

Downloading and saving files with AIR for iOs

For a project we need to download and save pdf files on an IPAD device for offline use through an AIR for iOs application.
After a lot of searching I haven't found much information on this subject. My question is, can it be done, and if so, can you provide us with some pointers to lead us in the right direction.
Thanks for your time!
Sure, first you check if you can access the web - can use a class like air.net.URLMonitor, if you can you can set up a URLStream instance.
You get data while its downloading the file using the progress event, write that out to a File instance using the FileStream class.
To display the PDF file you can use a StageWebView or HTMLLoader.

Resources