Fix compilation with "-reduce-relocations -reduce-exports"
Remove QtAndroidBridge dependencies. QtAndroidBridge needs to be rewriten, I'll disable it for now. Fix a lot of BogDan is an idiot bugs (only sw plugin is fixed).
This is very bad, is there a remedy for this? I need to call some Java functions from C++ side.
You could add a simple exported function in androidjnimain.cpp to return a pointer to a JavaVM variable (m_javaVM), as Sergey and I did in our branch months ago. You also should be careful about reattaching your thread every time you need to call a Java method -- BogDan's plugin, as far as I remember, liked to detach the main() thread on every Qt to Java call.
> Ah looks like BogDan disabled QtAndroidBridge; > commit 696253a4b39e80786bbdb4bb4f3d6391b472804d > Author: BogDan Vatra <bog_dan...@yahoo.com> > Date: Tue Dec 28 02:56:40 2010 +0800 > Fix compilation with "-reduce-relocations -reduce-exports"
> Remove QtAndroidBridge dependencies. QtAndroidBridge needs to be > rewriten, > I'll disable it for now. > Fix a lot of BogDan is an idiot bugs (only sw plugin is fixed).
> This is very bad, is there a remedy for this? I need to call some Java > functions from C++ side. > Regards, > ismail > On Thu, Feb 3, 2011 at 6:00 PM, İsmail Dönmez <ism...@namtrac.org> wrote:
>> Hi all; >> I am trying to use QtAndroidBridge but QtAndroidBridge::javaVM() always >> returns NULL, do I have to do something before calling that function? >> Regards, >> ismail
On Fri, Feb 4, 2011 at 11:40 AM, провод <marf...@gmail.com> wrote: > You could add a simple exported function in androidjnimain.cpp to > return a pointer to a JavaVM variable (m_javaVM), as Sergey and I did > in our branch months ago. > You also should be careful about reattaching your thread every time > you need to call a Java method -- BogDan's plugin, as far as I > remember, liked to detach the main() thread on every Qt to Java call.
> 2011/2/4 İsmail Dönmez <ism...@namtrac.org>: > > Ah looks like BogDan disabled QtAndroidBridge; > > commit 696253a4b39e80786bbdb4bb4f3d6391b472804d > > Author: BogDan Vatra <bog_dan...@yahoo.com> > > Date: Tue Dec 28 02:56:40 2010 +0800 > > Fix compilation with "-reduce-relocations -reduce-exports"
> > Remove QtAndroidBridge dependencies. QtAndroidBridge needs to be > > rewriten, > > I'll disable it for now. > > Fix a lot of BogDan is an idiot bugs (only sw plugin is fixed).
> > This is very bad, is there a remedy for this? I need to call some Java > > functions from C++ side. > > Regards, > > ismail > > On Thu, Feb 3, 2011 at 6:00 PM, İsmail Dönmez <ism...@namtrac.org> > wrote:
> >> Hi all; > >> I am trying to use QtAndroidBridge but QtAndroidBridge::javaVM() always > >> returns NULL, do I have to do something before calling that function? > >> Regards, > >> ismail
That is a bad idea, libQtAndroid_xx are PLUGINS, not libraries.
Currently they are loaded as libraries because I need to set some c++
<=> java connections, but is possible that in the future that this
plugins will be loaded directly by your application (QtCore module) as
plugins. If you are using them as libraries and more your application
require them to run, you'll have big problems.
Cheers,
BogDan.
On Feb 4, 9:40 am, провод <marf...@gmail.com> wrote:
> You could add a simple exported function in androidjnimain.cpp to
> return a pointer to a JavaVM variable (m_javaVM), as Sergey and I did
> in our branch months ago.
> You also should be careful about reattaching your thread every time
> you need to call a Java method -- BogDan's plugin, as far as I
> remember, liked to detach the main() thread on every Qt to Java call.
> > Remove QtAndroidBridge dependencies. QtAndroidBridge needs to be
> > rewriten,
> > I'll disable it for now.
> > Fix a lot of BogDan is an idiot bugs (only sw plugin is fixed).
> > This is very bad, is there a remedy for this? I need to call some Java
> > functions from C++ side.
> > Regards,
> > ismail
> > On Thu, Feb 3, 2011 at 6:00 PM, İsmail Dönmez <ism...@namtrac.org> wrote:
> >> Hi all;
> >> I am trying to use QtAndroidBridge but QtAndroidBridge::javaVM() always
> >> returns NULL, do I have to do something before calling that function?
> >> Regards,
> >> ismail
I disabled that library because it was a required library. I'm not
against of having an android specific library, I'm against to make
that library a required library for all apps.
For you, I see the following choices :
- export JavaVM and JNIEnv from qtmain_android.cpp (check QT_DIR/src/
android/cpp/). This file is compiled into your android application,
and you can do anything you want with it.
- create your own library, and be sure you export "jint JNICALL
JNI_OnLoad(JavaVM* vm, void* /*reserved*/) " method.
- create a good for all library, but be aware, you MUST maintain that
library for years, and you MUST be sure you NEVER break the API/ABI,
one mistake and all apps which are using it will stop working.
Cheers,
BogDan.
On Feb 4, 8:25 am, İsmail Dönmez <ism...@namtrac.org> wrote:
> Fix compilation with "-reduce-relocations -reduce-exports"
> Remove QtAndroidBridge dependencies. QtAndroidBridge needs to be
> rewriten,
> I'll disable it for now.
> Fix a lot of BogDan is an idiot bugs (only sw plugin is fixed).
> This is very bad, is there a remedy for this? I need to call some Java
> functions from C++ side.
> Regards,
> ismail
> On Thu, Feb 3, 2011 at 6:00 PM, İsmail Dönmez <ism...@namtrac.org> wrote:
> > Hi all;
> > I am trying to use QtAndroidBridge but QtAndroidBridge::javaVM() always
> > returns NULL, do I have to do something before calling that function?
On Mon, Feb 7, 2011 at 5:25 AM, BogDan <taipanroma...@gmail.com> wrote: > Hi İsmail,
> I disabled that library because it was a required library. I'm not > against of having an android specific library, I'm against to make > that library a required library for all apps.
> For you, I see the following choices : > - export JavaVM and JNIEnv from qtmain_android.cpp (check QT_DIR/src/ > android/cpp/). This file is compiled into your android application, > and you can do anything you want with it. > - create your own library, and be sure you export "jint JNICALL > JNI_OnLoad(JavaVM* vm, void* /*reserved*/) " method. > - create a good for all library, but be aware, you MUST maintain that > library for years, and you MUST be sure you NEVER break the API/ABI, > one mistake and all apps which are using it will stop working.
> Cheers, > BogDan.
> On Feb 4, 8:25 am, İsmail Dönmez <ism...@namtrac.org> wrote: > > Ah looks like BogDan disabled QtAndroidBridge;
> > Fix compilation with "-reduce-relocations -reduce-exports"
> > Remove QtAndroidBridge dependencies. QtAndroidBridge needs to be > > rewriten, > > I'll disable it for now. > > Fix a lot of BogDan is an idiot bugs (only sw plugin is fixed).
> > This is very bad, is there a remedy for this? I need to call some Java > > functions from C++ side.
> > Regards, > > ismail
> > On Thu, Feb 3, 2011 at 6:00 PM, İsmail Dönmez <ism...@namtrac.org> > wrote: > > > Hi all;
> > > I am trying to use QtAndroidBridge but QtAndroidBridge::javaVM() always > > > returns NULL, do I have to do something before calling that function?
> For you, I see the following choices : > - export JavaVM and JNIEnv from qtmain_android.cpp (check QT_DIR/src/ > android/cpp/). This file is compiled into your android application, > and you can do anything you want with it.
Forgive my noobness, but what would "exporting" mean specifically in this case?
I'm just scratching my head over the same issue (calling Java from native Qt), and experimenting with a global "m_javaVM" got me nowhere - plus it's not recommended as I have learned.