Is it possible to communicate with smartcard from QML? - qml

I want to know if it's possible for QML (because it's used in a lot of mobile OSes) to interact with a nfc smartcard i.e. credit card, transit pass, passport etc. or with C++ code also used in developing QML apps.

There is Qt NFC API, but it's only supported on BlackBerry devices. However, QML can be easily extended using C++, so if you can do it in C++, you can basically do it in QML. All you have to do is create appropriate bindings, which is not that hard.

Related

iPadOS USB Volume Control knob interaction programatically

I am working on a non-audio app for iOS and iPadOS and macOS. This question is specifically about iPadOS for now.
I purchased a generic "USB Volume Control" knob device. I am able to plug it into my (non M1) iPad Pro 12.9 and it does indeed control system volume (rotate), as well as things like rotate through tracks in the Music app (push and rotate), mute (push), etc. I have a second such device from another manufacturer on the way to test with as well.
What I'd really like to do is use it in a non-music context. To be able to capture the raw actions and interpret them in my app's subject domain (DCC model train control).
I have been able, on iPadOS but not iOS [as it doesn't have generic USB support as I understand it] to capture the volume changes by using AVAudioSession and KVO tracking the outputVolume property. I haven't yet figured out how to get the push and push-rotate yet but assume I just need to find the analogue functions in AVAudioSession or some other Apple class.
But I would rather not dink around with the Audio/Music classes and have to "re-purpose" them into my own control needs and was wondering if anyone knew of a way to be able to find and connect to the device and get the values directly.
As iPadOS now has pretty good generic USB support for all sorts of devices, I am hoping there is a way for me to provide service to/with/from those devices but I can't find information through normal internet searches. Poor Google-fu.
I looked at the External Accessory framework but my understanding is that only for MFi certified devices and my attempts to detect the devices have not worked as these are generic USB devices. (Unless there are generic protocols one can register for and make this work).
Thanks for any hints, pointers, admonishments, etc. RTFM is welcome if you tell me the M.

Bluetooth file sharing in iPhone/iPad

As far as I know, Apple does not allow bluetooth file sharing in iPhone/iPad.
Is there any way to write a code in Objective-C to make an application to share files?
If you only need to communicate between other iOS devices, Apple provides a high-level GameKit framework to make it easier to handle Bluetooth communication, which should allow you to share file data. Here's a tutorial I found: http://www.devx.com/wireless/Article/43502/0/page/2
I’m not sure, but I think Apple only allow members of the Made for iPod program to access the low-level raw bluetooth APIs, and even then, can only with certified external devices.
http://developer.apple.com/programs/mfi/
If you want a simple way to share files and other data between devices of other platforms, you might want to have a look at the Bump API: http://bu.mp/api

How is it possible to access function of app A from app B

I was wondering if and in how many way an app can access specific funcions of another app.
for example
open an url in safari/firefox/chrome
run a javascript in current browser-tab
play/pause itunes
rename selected files in Finder
I am aware of the existence of applescript but i was wondering if that's the only way i have to interact with those apps and others
thanks
There are three main ways an app exposes its function to the outside world.
One is by supporting an URL protocol. To open an URL, just use NSWorkspace. There are many methods; if an app registers a specific protocol like x-my-app://some-work, you can just do
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:#"x-my-app://some-work"] ];
If you want to open an URL whose protocol (say http) is supported by many apps and if you want to specify which app to use, use openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:
.
Another is the System Services. With this, an app can add entries in the Service menu and in the context menu of other apps; you can also call it programmatically.
Otherwise, it's via Apple events. Applescript is one way to deal with them, but not the only one. It's just a language to issue Apple events. There are many ways to deal with Apple events from Cocoa, see this detailed document by Apple.
Basically, an app can export its internal as an object-oriented manner (which is not just its Objective-C hierarchy; you can control how much of its internal objects and methods you expose, etc.) by an sdef file. Then, another app can use this object-oriented system via Apple events.
To send and receive Apple events, you can of course construct them by hand, but you can use higher-level objects like
Applescript via NSAppleScript
Scripting Bridge
or AppScript.
To learn what kind of aspects an app exposes, just open the AppleScript Editor and choose the menu File → Open Dictionary, and choose an app.
Now, it's rather hard to use features of an app which the app does not expose via any of these methods. You still have a few workaround.
UI Scripting. This is done by sending Apple Events to a headless app called System Events which is one of the core program in OS X. This way, you can programmatically emulate clicking a button, choosing a menu, etc. of another app. So, almost whatever you can do using GUI with another app can be done programmatically from another app. To see the hierarchy of UI objects accessible from UI scripting, use a utility which comes with XCode tools, at
/Developer/Applications/Utilites/Accessibility Tools/Accessibility Inspector.app
This is very rudimentary but does the job; if you regularly use UI scripting, consider obtaining UI browser, as Zygmunt suggests.
Finally, if you want to use a non-GUI non-exposed feature of another app, you can inject a code into another app.
Just expanding on Yuji's answer. If you were forced to go the UI scripting path, there's a nice application to analyze the interface - hxxp://pfiddlesoft.com/uibrowser/. However, the examples you mentioned should expose some APIs.
I might also recommend using Sikuli hxxp://groups.csail.mit.edu/uid/sikuli/ as an IDE to script around user interface robustly.
For some applications usually coming from GNU/Linux there is D-BUS hxxp://en.wikipedia.org/wiki/D-Bus - although I haven't used it on a Mac on my own yet. And let me also quote Wikipedia about Cocoa "It is one of five major APIs available for Mac OS X; the others are Carbon, POSIX (for the BSD environment), X11 and Java." hxxp://en.wikipedia.org/wiki/Cocoa_%28API%29 That's just a loose tip for further exploration as Yuji has already explained Apple events that are key to your question.

Does Apple provides any library or API to manipulate the CalDAV?

I want to ask a question about the iPhone application. I am going to write a program which is related to a calendar function. I want to use the CalDAV to do this. However, I am not familiar with the iOS environment. Does the apple provides any library or API for the developers to write the program by manipulating the CalDAV? Thank you very much.
With iOS 4 you can access the users calendar with Event Kit. But you can't directly work with CalDAV. You have to use a third party library for that.

Free Modem Dialer

Is there a telephone application for modems that can receive a phone number as a parameter and manage the call for themselves? I ask because in my application I must implement a click2call functionality and may be is a free software out there that I can use and I do not have to fight with TAPI. Thanks!
Here are a few wrappers available to abstract away the complicated parts of using TAPI.
TAPI Wrapper
http://www.vbrad.com/article.aspx?id=61
Normally, the domain of C/C++ programmers, this wrapper code will allow you to skip all the complexity and get to work straight away.
ATAPI - Managed TAPI wrapper for TAPI 2.0
http://atapi.codeplex.com/
Managed .NET library for interacting with the Microsoft Telephony API (TAPI) 2.x. This library is for creating clients that consume telephony services on Windows XP or better.
WombatDialer does something like that for the Asterisk platform and has powerful APIs - see http://www.wombatdialer.com/manuals/WD_UserManual-chunked/ar01s08.html
It manages the call flow internally (scheduling, error conditions) and sends HTTP notifications of events.