Usb disk availability notification - delphi

How do I detect usb disk availability? When I connect my Android phone to pc, it appears as USB disk but it's not accessible until I tap "Turn on USB storage" on the phone's screen. Is there an event I should use? I know there is a proper way to do so, please advise.
Update: It seems I need to explain: in a case like with my Android phone Windows doesn't send WM_DEVICECHANGE when i turn the phone storage on. Perhaps, it similar to card readers or cdrom - a letter assigned to the drive, but you can't access it until memory card or cd inserted. I want to be notified somehow when this happens. I could use polling of course but it doesn't seem to me
very efficient. I'm sure this should be possible because the Windows Explorer does somehow detect the changes.

Related

How do wifi bulbs pair with the mobile

I have been working on making a commercial-equivalent smart WiFi bulb. I cannot understand how the bulb pairs with the app on smartphone and gains access to the Internet through my personal modem. The bulb cannot communicate through the personal WiFi before getting paired, as it doesn't have the credentials. I tried to experiment with my existing commercial bulb and while putting it in reset mode, noticed -
There wasn't any WiFi (that could be the bulb's AP) visible in the available networks list of my PC. Well, I don't know if it was a hidden network.
There wasn't any Bluetooth device visible in the list that could possibly be the bulb.
So I want to know how the bulb communicates with the app -
Does it act as AP (Access Point) and the app connects to it and gives it the credentials.
Else, does the bulb use any other type of communication to pair with the app.
Or, does it somehow just get to the smartphone and it all "mysteriously" works.
I would be happy if someone could explain the process to me. Also, the app scans for the available devices whenever I want to pair to a new device. Then, I can select the desired device and pair it. So, please also explain (if possible) how the scanning works.
No need to get to each technical detail, I just want to know the process. I will ask later if I need the tech details.

Can you communicate with nearby devices using a website?

Can a website help a user communicate with nearby devices via bluetooth/WLAN without downloading software?
User requests that something be done on their device (which could be, for example a wirelessly connected printer or a bluetooth keyboard).
The site, which contains a repository of relevant actions, sends specific instructions for that device to the user's own machine.
Those instructions are then relayed to the correct device (with the user's permission) via the user's device's WLAN or existing bluetooth connection.
Part 3 is what I'm not sure of - is there a mechanism by which a website can contribute to a wireless/bluetooth connection held locally?
It is not possible. User browser can't interact with hardware for wireless networking.
You should force user to install some custom software to do this.
You would have to submit the "commands" first, then have the device make requests to the website server, i.e., check for any pending "commands" for the device, and then process them locally. A website is not "thing" that can directly interface with a hardware device.

Check blackberry is connected via USB

I am doing an application which access the SD/Media card to display its images. But when device is connected via USB I cant access the media card. If thats the case, I want to show a message to user asking him to disconnect device form computer.
How can I programatically check that SDCard is accessible or not ?
How can I check whether the device is connected to computer via USB?
Thanks.
I am not sure about your second question about checking whether the device filesystem is mounted via USB on a computer, but as for the first question, to check the available filesystems, call FilesystemRegistry.listRoots(), which will return an Enumeration of String objects. If "SDCard/" is in the enumeration, then the SDCard is available.
Some devices can also store images on the device storage as well, which is distinct from the SDCard. In that case, check for "store/" as the filesystem root.

Can an iOS app control a phone call?

My Mom's deaf. I typically talk to her using a TTY service and she has a TTY phone at her house. I've looked in to iOS TTY and all it ever says is about connecting a cable to the iPhone to use a physical TTY. TTY uses 50bit per second baud-dot code for communications it should be trival to write a program that generates it on the iPhone. Just a sequence of tones, at a relatively low baud rate. BUT I need to be able to control the phone functionality from an app... Then I could type messages like "txting" and have it send baud dot code to my mom's phone. (I've tried giving her a computer, but she's 86... Old dog... new tricks...)
Any ideas?
No, it not possible. The official iPhone SDK does not allow this kind of interaction with the phone.
You can't do this on the phone, but you could try to make a webservice that does it instead. Then have the app connect to the service to deliver the message.
TAPIComm on this page looks like a sample to work from
http://www.tapi.info/default.aspx/TAPI/PSDKSamples.html
You'd need to run it on a Windows machine with a modem.
I know you were looking for an iOS solution, but it another option might be to switch her to an android phone, since android gives you MUCH more access to basic, deep-down elements of the OS, including access to the voice data stream.

Can an iPhone application running in the background transfer data via USB interface?

There are 2 iPhone applications. One application running in the foreground and the other running in the background. Is there any way to get the background application to send data over USB without coming into foreground? Ideally we want to keep the foreground app in the foreground, while the background app process some data. Once the data is processed it will inform the foreground app that the data has been processed.
No it cannot. It cannot even do this without the use of private frameworks, unless you're in the Made for iPhone program. If you are, then your organization will know, based on the documentation made available to you, what you can and cannot access, when and how.
Should you be in the Made for iPhone program, and are unclear as to what you have access to and when, contact the person in your organization who is the technical contact with Apple for this program, they will be able to give you the details.
If the task is started while the app is in the foreground and you call the appropriate beginBackgroundTask/endBackgroundTask methods, you should be able to have it continue running after the app is backgrounded.
Note that access to USB is restricted (see jer's answer) and that there's no officially sanctioned way to communicate between different apps on the same device. Also, you can only buy/download one app at a time in the App Store and I can't see Apple approving an app that required you to download a second app for it to work. So you may have bigger problems to solve first.
It would help significantly if you told us what you actually wanted to achieve. For example, "I want MyApp on the user's phone to communicate with MyApp on the user's computer".
The absolute easiest way is to send data between the phone and a computer is to require that they're both on the same Wi-Fi network. Several iPhone apps incorporate a web server (this was the easiest way of "file sharing" before OS 3.2), and many more iPhone apps connect to a computer running server software.
Your other options, more or less:
Reverse-engineer the Bluetooth side of GameKit and reimplement it on the computer-side. I'm not aware of anyone who's done this. Loosely, I think it's IP over Bluetooth PAN plus some sort of Bluetooth service discovery.
Audio input/output, e.g. the headphone jack or certain pins on the dock connector. I'm not entirely sure how the mic side works (the resistance was a bit high for a carbon mic when I checked), but you might get lucky and find a way to turn it into "line in" or find "line in" pins on the dock connector.
A webcam pointing at the iDevice screen (and the iDevice camera pointing at the computer screen). Ewwwww.
Join the MFi program.

Resources