How to send SMS in Qt for Android? - android

What is the official API in Qt5.2 (which started supporting Android and iOS officially) for sending text messages? or generally the Messaging API.

Currently Qt mostly work for GUI only stuff on Android. To be able to do what you want you have to call Java code from C++. I suggest you start of by extending QtActivity (and call super on the functions already implemented like onCreate() etc.). Then you would have to code using the Android SMS Manager class.
More information and an example on how to call Java code from C++/Qt can be found here.
This should get you started if you decide to proceed.

Related

Custom Activity class in a Cordova app?

Is it possible to make a Cordova app use a custom subclass of CordovaActivity?
This question was originally about detecting arbitrary key events in a Cordova app. But now I think this is impossible for the same reason it's impossible to receive key events in a Service. However, I'm thinking that if I could extend CordovaActivity, I could override the onKey... methods and broadcast something on the LocalBroadcastManager, which could be received by a plugin.
I'm trying to capture the KEYCODE_HEADSETHOOK that is generated from an audio jack phone handset. We tried listening for the onkey... events in JavaScript. No dice. Since neither CordovaActivity nor CordovaWebView overrides any of the onKey... methods, I don't know if or how the JavaScript receives any key events at all.
According to an "Official Rep" in the PhoneGap community forums, this was not possible as of July 2012.

how to control outgoing intnet in android?

is it possible to access and control all outgoing intent from my app?
i use some library in my project that sends intent to start other app (for ads) because that library is compiled i have no access to the source code.
i wonder if there is any way to block or control all intent sent by my app.
if you know any other way to prevent that app to start (ads) please tell me.
i think because my app start the other app, there is a way to stop it.
You might be able to use reflection on the library and hook the google API calls but you have to check the licensing scheme for the added library so that you do not do something illegal.

Extend/ Modify Sencha Touch 2 Native Packaging for Android

How is it possible to modify and extend the Sencha Touch 2 Native Packaging for Android (see http://docs.sencha.com/touch/2-0/#!/guide/native_android)? I want to add a Push functionality to the Android Project.
IMO, you should use cordova(phonegap). With that, you'll get plugins to add push in your app. As far as I know, there's no way you can use PUSH with Sencha Touch itself. To work with Push you must have a device id. Sencha can not give you that (unless you manage to call functions inside your activity from javascript). Moreover, you need to have a broadcast receiver set up to listen to incoming push messages. Basically, there's bunch of to-do's involved in using Push, so you can not simply automate that job and let native packaging do it.
Modifying/extending sencha tools native packaging is not simply worth it considering time and efforts that would take (if possible).
You should check out http://www.pubnub.com/ they have Javascript client to do listen to a queue and using that you can extecute whatever you want once message is pushed.

C2DM handle registration properly

I want to use C2DM in my android application. I am using code schemas shown in official tutorials. Everything seems to work fine, but I have problem with handling registration properly.
There are 2 methods in C2DMMessaging class which I have to use: firstly register() and next getRegistrationID(). If I use them sequentially, I get null form the getRegistrationID(). The problem is registration is asynchronous. In my application in the beginning I need to know the regidtrationId, I can start the rest of the app only after I get it.
I tried to do some synchronization using monitors (i.e. wait() in register method and notify() in C2DMReceiver.onRegistered()), but it didn't work (the code of onRegistered() hasn't been reached, after calling wait() in register()).
In other words what I need is making registration synchronous, so I could continue, only after I get registrationId. What is the right way to do it?
Make sure you are following below guidelines:
To develop and test on the Android Emulator, you need to download the Android 2.2 version of the Google APIs Add-On into your SDK.
Make sure you set android:minSdkVersion="8" in the manifest.
Make sure you have at least one Google account synced on your emulator or device.

Calling native Android kernel function from user code

As my Motorola i1 refuses to light its LED in the usual programmatic way (using NotificationManager with LED on specified), I've dived into Android Cupcake's source code and found out that the native applications such as Calendar & Messaging do this using NotificationManagerService, which uses
IHardwareService.setLedState()
which, in turn, calls the
setLightFlashing_UNCHECKED()
function of the kernel (or is it a component other than the kernel?).
How do I either instantiate the HardwareService implementing IHardwareService, or call the setLightFlashing_UNCHECKED myself?
You can't, applications don't have permission to directly access such hardware.

Categories

Resources