Bluetooth: how to send large files - bluetooth

I need to make an Android application that sends large files (100-500 KB) over Bluetooth.
It is very important to preserve the integrity of the data, avoid any corruption of the files sent.
Please should I implement my own protocol?
Is there a suitable profile that I can use? (it seems profiles support is limited in Android...)
Any third party library?

This depends on the profiles that are implemented.
OPP - Object Push Profile can send files, but this is often limited to V-cards and in some case images.
FTP - File Transfer Profile can send larger files.
There is no specific application needed, you should be able to do it from native android as long as both devices supports the profile in question.
For example, enter the gallery and choose to share an image over Bluetooth, then select the receiving party.
Or enter file manager and choose to share file over Bluetooth.
If you want to write your own program that sends files, you can find the specifications for the profiles and protocols on Bluetooth.org or developer information on Bluetooth.com

Related

WebUSB API, for pushing commands/configuration to the device through webApp

I am doing some research on the WebUSB API for our company because we are going to start to manufacture devices in house.
Our current device manufacture comes with an application so the team can plug the device into a computer and diagnose it. Their application allows us to read outputs from the device, as well as pushing commands/configuration to the device over a wired connection.
Since this device is 100% ours, we are also responsible for building out the diagnostic tooling. We need some sort of interface that allows a user to read outputs and send commands/configuration to the device over a wired USB connection.
Is the webUSB the correct API? If not, what are some suggestions for accomplishing the requirement? Are we limited to building some sort of desktop or mobile application?
I would recommend resources below to read to help you understand if the WebUSB API fits your needs or not:
https://web.dev/devices-introduction/ helps you pick the appropriate API to communicate with a hardware device of your choice.
https://web.dev/build-for-webusb/ explains how to build a device to take full advantage of the WebUSB API.
From what you describe, WebUSB isn't strictly required but won't hurt either.
First and foremost, you will need to implement the USB interfaces reading data and sending configurations. It will be a custom protocol, and not one of the standard USB device classes such as HID, video or mass storage. The details of the protocol and if you use control, interrupt or bulk transfers is your choice.
I'm assuming you will connect the devices to Windows PCs, and you likely don't want to put money into writing device drivers. If so, the easiest approach is to add the required descriptors and control requests required for Microsoft OS 2.0 Descriptors. That way, the WinUSB driver will be installed automatically when the device is plugged in.
Using the WinUSB API, a Windows application will then be able to communicate with the USB device. No additional drivers are needed. (On macOS and Linux it's even easier as you don't need the Microsoft OS 2.0 Descriptors in the first place.)
On top of that you can implement the additional descriptors and control requests for WebUSB. It will provide the additional benefit that you can write a web application (instead of a native application) for communicating with the USB device. (Currently, you are restricted to the Chrome browser.) WebUSB devices should implement the WinUSB descriptors as the alternative (.INF files, manual installation process) is a pain.
The already mentioned web page https://web.dev/build-for-webusb/ is a complete example of how to implement it.

While working, How do you share codes, files between two devices?

While working, I'm always having problems related to data sharing.
For example:
I have a computer connected to the printer but my laptop is not and I want to print a file, how do I easily move that file to the printer computer?
How to share a file from my mobile to laptop?
What I'm doing right now is moving the file using a USB disk, e-mail address or facebook.
You as developers, what are you doing for such purposes?
What I do is using network because its fast and safe.
But if I have a good internet connection I would suggest you to use Ziggs.io - Smoothly Share Content Between Devices.
The bad fact about Ziggs is that you need an internet connection to use it.
What I like about it that you don’t have to register, you can share files up to 500 MB per file and they don’t store messages.
More about Ziggs from their website:
What is Ziggs?
Ziggs is a platform that exists to facilitate peoples communications
Ziggs is like a meeting point with your devices, it helps you to
transfer contents between these devices smoothly.
Drag-and-drop PDFs,
images, videos, APK apps and other files directly into Ziggs.
Messages
are delivered directly from your device to the connected clients.
Ziggs doesn't store any type of data and doesn't require your personal
information.
Ziggs uses smart solutions based on client-side to share channel conversation history with new clients.
Exists channel clients will act as seeds, helps new clients to follow up with the conversation.
I've built my own cloud for this exact function:
https://www.github.com/TheWlr9/LocalCloud
However, this question should've been posted on some forum page, and not Stack Exchange.

what is the difference between api and device files in linux?

Difference between an API and a device driver
From the above link i read that API is like a specification that describes what to do, while a driver is an implementation that describes how to do it.
Now, i couldn't find API in linux for display, audio etc.I have also read on internet that linux provides device files to interact with device drivers. we can communicate to devices by writing or reading in those files but as written above API is the specification that describes what to do and API layer is missing here.so, i don't know what commands to writes in those files to interact with devices. ex-rasterize a image on display with the help of these device files.
Device files are just a practical way to communicate between user space and the kernel. Some device files (most notably, block devices) have a uniform API to them, but that's kinda besides the point.
For most standard operations, you would not interact directly with a device file, but instead use a library, exposing a documented API, for doing what you want. So, if you want to play sound files, you'll use, e.g., libjack, or even a higher abstraction layer, such as gstreamer or libvlc.
It is possible, and even likely, that those library use a device file for their actual output. You need not deal with that, unless you want to.
In other cases, you do want to open the device file and interact with it. In those cases, you need to read the relevant documentation to see how to do that. Some device files merely accept read and write requests. Others, such as tty devices, have ioctl commands that modify how they work. The man page for the relevant device will tell you what you need to know.
In general, many treat device files as extension of the kernel's API. In fact, many call the ioctl command "user defined syscalls". In all cases, just read the documentation to see what you need to do.

Does Avaya have an API for retrieving the audio stream of a VoIP call?

I have been up and down the documentation and all over the web looking for an answer to this question but have not had any luck. I have a project where I am looking to retrieve the live audio stream from an Avaya telephone call and then transcribe the call as its happening.
Does Avaya support this functionality?
You may use DMCC (which has bindings to different languages and also a language-agnostic XML interface), which implements CSTA ECMA-269 industrial standard. It has several methods to start an API session (StartApplicationSession), subscribe to events (MonitorStart) and assume first-party control over a device (RegisterTerminal). If a device is registered by an application in client-media mode, you may directly access the RTP media stream coming into and going out from the phone. RTP address, port and codec are contained in MediaStartEvent responses which you can receive via DMCC once you've set the event subscription properly. There's also a distinctive RecordMessage method that writes the audio stream from a device to a file (which you may process later).
Registering a device will likely consume a «DMCC license» (one for each registered device). If you use third-party call control methods (such as MakeCall or AnswerCall), a «Basic TSAPI license» will also be consumed for every controlled device. I've discovered out that a «Basic TSAPI» license is consumed as soon as you issue a MonitorStart request to subscribe to events. You may want to consult your vendor about how to obtain the appropriate amount of licenses for your AES. I personally found Avaya licenses rather complicated in terms of understanding what license set exactly your application may need. There's my thread on Avaya's DevConnect resource which may shed some light here.
Playing with your Avaya AES installation using the DMCC Dashboard is a good way to familiarize yourself with DMCC API.

how can I save data in mobile phone using j2me?

How can I save data in mobile phone using j2me?
I want code examples which describes how to store data in mobile phones using j2me.
Further how to give access permission to read/write in mobile phones?
I am using netbeans 6.5 and motorola L6 phone.
Can any one tell me a code example giving how to store, give read/write permission?
You can save data in the record management store. There are some limitations though. The biggest one is that only your application will be able to read the data.
An alternative is to use the FileConnection API, which offers access to the device's file system. All modern phones should support it. However, unless the Midlet is signed, the user will be nagged to give permission to access a file.
Use the PDAPDemo example code from the Sun Wireless Toolkit.
Last time I checked it had a few error handling bugs but it is easily modifiable.
It will tell you what parts of the handset file system your application can read from and write to, both on the phone and on any eventual memory card.

Resources