Android auto update
-
@Kutyus my share example has implemented Android FileProvider https://github.com/ekke/ekkesSHAREexample
-
@ekkescorner said in Android auto update:
@Kutyus my share example has implemented Android FileProvider https://github.com/ekke/ekkesSHAREexample
Great example.
Got it to work immediately with Qt5.12.7, but failure with Qt5.14.2.
Are you interested to get a bug report? And when where? -
@koahnig said in Android auto update:
Got it to work immediately with Qt5.12.7, but failure with Qt5.14.2.
Are you interested to get a bug report? And when where?please report at gihub issues https://github.com/ekke/ekkesSHAREexample/issues
unfortunately most of my examples are 3 years or more old and last 2 years I had to develop so many mobile business apps, so I didn't found enough spare time
the good thing: starting with Qt 5.15 I'll rework all my examples and blogs to get mobile apps ready for Qt6 / strict QML 3. will reduce work for customers next months and concentrate on 5.15 / 6.0. with some luck all of this will finally end in a book (fingers crossed)
-
Thanks. Report created
-
@koahnig thx reporting. will test when I've done my switch from 5.13 --> 5.15
-
@sierdzio
Hi!
I made the settings, but on this line, there is always an error:QAndroidJniObject uri = QAndroidJniObject::callStaticObjectMethod("android.support.v4.content.FileProvider", "FileProvider.getUriForFile", "(Landroid/content/Context;Ljava/lang/String;Ljava.io.File;)Landroid/net/Uri;", activity.object(), authority.object(), file.object());
System.err: java.lang.NoSuchMethodError: no static method "Landroid/support/v4/content/FileProvider;.FileProvider.getUriForFile(Landroid/content/Context;Ljava/lang/String;Ljava.io.File;)Landroid/net/Uri;"
I also tried the getUriForFile method without the FileProvider prefix, the same error anyway.
-
I don't know JNI enough to answer, for me it's always a bunch of trial and error to get it to work :D
-
@Kutyus Your JNI call is not correct, you pass wrong method name!
It should be:QAndroidJniObject uri = QAndroidJniObject::callStaticObjectMethod( "android.support.v4.content.FileProvider", "getUriForFile", // only the function name!! "(Landroid/content/Context;Ljava/lang/String;Ljava.io.File;)Landroid/net/Uri;", activity.object(), authority.object(), file.object());
-
@KroMignon said in Android auto update:
I tried anyway. The error in the second parameter was slashes instead of periods in the java.io.File section.
If I log out after the call, I get an error that there is no activity handling the intent, if I don't log out immediately, there is no error, but nothing happens. I don't know where the error might be. -
@Kutyus You are right, there are many typos!
QAndroidJniObject uri = QAndroidJniObject::callStaticObjectMethod( "android/support/v4/content/FileProvider", "getUriForFile", // only the function name!! "(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;)Landroid/net/Uri;", activity.object(), authority.object(), file.object());