Send Image as data in Core Bluetooth - ios

I want to send an image from one device to another using core bluetooth framework. I am able to send string data. How to send an image between two devices

In exactly the same way that you send the string data. Get the image data with UIImageJPEGRepresentation.
If you need to limit so that you don't send too much at any one time, you can split the data into packets using getBytes:range: (or subdataWithRange:).

Related

How to calculate SIM GPRS data which is uploaded by Quectel M66 during GET method?

I am using Quectel M66 module to send data to web server using GET method. I am uploading data every minute using two APIs. I am using airtel SIM which consumes 2MB of data per hour as per shown in my airtel app. So I want to calculate how much data is actually uploaded by GSM module M66 ?
Thanks in advance.

Sending Core Data objects to "read only" Apple Watch App

I am trying to develop a watchOS 2 app to go along with my iOS app. The iOS app utilizes Core Data, and the Apple Watch app is simply going to be a "read only" client and display the data from the iOS app.
I have read a few things regarding managing two data stores, but that seems to be overkill. I just want to transfer the data to the watch app on launch then send background transfer if things change on the phone.
My question is how do I send this information to the watch app initially? I don't think I can send the actual data objects to the watch app. Do I need to convert the objects to a dictionary and send all of the relevant information via the WatchConnectivity API?
Your approach sounds good. Mirroring your CoreData database on your watch app would indeed be overkill if you don't play to change the data on the watch.
So using the Application Context to send the data via background transfer is the right choice. This has only one caveat: The updateApplicationContext method that you use to tranfer the data only accepts a dictionary of property list values. In other words, you can only send objects that you could add to a property list:
Array
Dictionary
String
Data (NSData)
Date (NSDate)
Integer
Floating-point value
Boolean
So, you'll have to convert your Core Data objects to dictionaries that contain only those types, before you can send them.
That's a bit of an effort, but you would have to do that anyway even if you wanted to mirror your database on the watch side, because with watchOS2 you cannot use App Groups anymore to share CoreData files.

ios:how to continiusly send images to server from camera feed?

I am implementing a feature in my app that needs to take images from camera live feed and send it to server for barcode detection. I already have an message class that I can pass an image to and it will take care the communication with the server. But I am struggling to see how to implement the continuous image sending.
Here as the steps that I see right now- have a loop where I would capture images via AVCapture, then send them to server via my message class(in separate threads?) till on of them returns positive result from the server. Does my logic sound right?

How to transfer large amounts of data via bluetooth on iOS

If you have to use bluetooth LE. How do you transfer large amounts of data OR data at a faster rate, via bluetooth on iOS?
You try not to. You can't go faster. To transfer lots of data you send lots of small packets.
Basically, don't use BTLE.
Turns out my first post got additional answers and I just need the ExternalAccessory Framework

iOS Offline data buffer

Greeting everyone,
I am looking for a simple way to but my data in a buffer if I ever don't have access to Internet for a certain time.
Lets take a GSP app as an example: I am somewhere with no cell tower but my GPS registers my location. Then when I gain Internet back, it will send these location to the server.
I am currently using restkit to post my objects to the server. When the object is sent to the server, I don't really need it on the phone. So in a way I don't need a 1:1 sync between the iphone and the rest api.
The only idea I have is to have a simple local database (SQLite ?) and monitoring the connection, So I insert in the database when its offline and as soon as the connection is back up, I send the rows and delete them from the local database.
Anyone has a better idea?
Thank you
Jonathan

Resources