Recently the company mobile development classmate walked, temporary spur looked under.
Android development of Java will not, iOS OC also did not really play, the previous C + + is relatively familiar, see the recent QT even out of two versions 5.4,5.5, seems to be good, looked at the next.
QT Support cross-platform, not much to say, originally looked at this feature to play.
First play Qt for andriod, some native things or rely on Android itself, that requires Java, so first play the next C + + call Java
The return value is always incorrect when you encounter a problem. The specific question is said below.
1. Using JNI technology, the use of encapsulated qandroidjniobject is very convenient, no traditional JNI, after all, has been encapsulated a lot simpler.
But it also brings a problem, the call fails, no exception is thrown, and there is no specific way to get the appropriate error message. The original JNI seems to take exception information through Env. If you know a spectator, you will hear it.
2. Call static methods have Callstaticmethod and Callstaticobjectmethod, the previous return value is a standard type, available template parameters
The second one for the return value is the object. The return standard type is easy to succeed, with little chance of error.
3. Call instance methods have Callmethod and Callobjectmethod, the difference is similar
4. The return value parameter is shown in the Help document.
A point that is prone to problems,
Object definition last semicolon (Callstaticmethod and callmethod not required)
[For array objects, not arrays do not add"Just because it didn't pay attention to wasting a day."
Object Types
Type Signature
Jobject l<fully-qualified-name>;
Jclass
Jstring
Jobjectarray [l<fully-qualified-name>;
Jarray [<type>
Jbooleanarray [Z
Jbytearray [B
Jchararray [C
Jshortarray [S
Jintarray [I
Jlongarray [J
Jfloatarray [F
Jdoublearray [D
Primitive Types
Type Signature
Jboolean Z
Jbyte B
Jchar C
Jshort S
Jint I
Jlong J
Jfloat F
Jdouble D
Other
Type Signature
void V
-----
Just say the questions and points, simple point, the main is to record their own. The spectators forgive me
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Problems with QT learning record 1-QT C + + call Java