NSData access in iOS for external accessory - ios

I am trying to transfer the photo image data accessed from the Photos framework to my external accessory. I am able to transfer the data. However, I am not able to open the file correctly.
I access the data of the image using the NSData in the PHImagemanager.
I am transferring the image to an external device (SD card using the External accessory protocol). The transfer takes place successfully. I can see the ASCII contents of the original file and the transferred file and they both look the same. But I cannot open the file.
I was thinking that do I have to do some processing on the data I receive through NSData to open the image successfully?

Related

Do iOS devices store the GPS location in their .mov files

I get all kinds of EXIF data (like location and camera model) easily from images, and I'm trying to replicate this for my .MOV movie files pulled from my iPhone.
I know Apple has this information somewhere because you can see the location in the Photos app, but I don't know how to programmatically access this when looking at .MOV files directly.
In order of preference for my use-case (Python-based personal photo organizer / enrichment):
Is this available ideally somewhere in the file (or another file) itself
Stored somewhere in iCloud that is queryable / scrapeable
Available when building an iOS application (thinking I could build a sync-type app)
To get created date and other properties of MOV files so far, I'm using hachoir based on this StackOverflow answer:
Getting metadata for MOV video

IoT Edge Offline Data Storage decoding .log data file

I have mounted local storage to my Edge Hub/Agent Modules, and when the device goes offline it stores the data locally. In the event that the device cant go up online, I need to be able to read the offline data and send it to IoT hub. After looking at the file, some portion of the message is base64 encoded, and some parts have non-base64 encoded characters.
Is there a method for decoding the message or any architecture patterns to support cases when a device can't go back up online and upload the data?

How to get the saved text file from my iOS App to PC?

I build an iOS App that collects data via BLE and saves it as text files. What I want to do now is to retrieve the saved data on my PC (Windows) for further analysis. As the developer I know I can download the App container via Xcode for accessing the saved file and it works well. However, I wonder if there’s any approach that I can get the saved files without using Xcode? Can I save the text files to a public location so I can access them directly?
In short, you can't do what you want in this exact way, as iOS devices do not support the USB mass storage protocol. The only way to get files out is using iTunes, which can access your iOS device's Documents folder.
Of course, you could reverse-engineer that protocol, but that's a bit unreliable and might break if Apple ever changes something.
Instead, find another way. E.g. you could have your PC app contain a tiny HTTP server and have your iOS app send an HTTP request to it that contains the file's data. Alternately you could even go via an actual server on the internet.
Or, given all iOS users have iCloud, you could also just save your data to iCloud, then have your PC users install Apple's iCloud for Windows stuff and then just access the file from there.
If I understand you correctly, you want to access the client's data on the PC.
You can create a file server or use a third party service like Amazon S3(https://aws.amazon.com/s3/).
Client upload that collects data through the http/https protocol.
PC download the client's data and analysis.

Core Data - Savings and sharing images via iCloud

I have an app that allows a user to either take photo or point to a photo on from their camera roll. This record must be peristed locally. A record consists of text and an image. Savings this data on a single device seems simple, as I can persist the link to the image or store the image locally in the file system if taken via camera.
Problem is how to share this record via iCloud to make record available to all instances of the app on multiple devices. I.e iPhone creates a record with an image, which is then available to view on iPad or Apple TV.
Is it efficient to store a UIImage in a Core Data record and make this available via iCloud? Many people saying not for local storage
My concern is this could potentially be some large quantities of data?
Does anyone have any thoughts on how to solve this issue?
I´m working on a similar app, for me working with http://Parse.com is a solution.
If your user have an internet connection and can wait to upload the images/text files you can save it directly using Parse (with a fancy progress Bar!) But if you want to make it network-less proof, you might work as whatsapp. I mean using Core Data to save your files locally, then try to upload the imagens whenever there is internet available.
There are some others clouds DB you can use, but I´m familiar with this one.
You can upload to iCloud using NSFileManager.
There is a complete walkthrough on how to do that.

Is there any way to Protect Document Directory in IOS

Is there any way to Protect Document Directory in IOS. Any other can not show it's data via any other software? Any encrypted method Or Password Protected for we can protect Data.
My Application is related to Music App. In My app we download songs in Document Directory.
Any user can listen songs via my application. but they can not access that song via any software.
For ex. If we use iFunbox From Mac we can get every data. We don't want to access my data from that kind of software.
Any way to protect my data?
I don't know any way to encrypt an entire directory on iOS devices but you could take a look at RNCryptor to encrypt the songs that your app downloads.
RNCryptor - Github
You can user it to enrypt the songs individually and decrypt the data before you play them in your app.

Resources