Change in How Run() and Execute() Work in Android

Discuss any general programming issues here
Post Reply
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Change in How Run() and Execute() Work in Android

Post by PEB »

In the previous version of Hollywood for Android, I could download an .apk file from my server and install it programmatically using Run(). But now I get this message:
"Cannot find viewer for extention *.apk!"

Is there a different way that the package installer needs to be called now?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Change in How Run() and Execute() Work in Android

Post by airsoftsoftwair »

Actually, Run() and Execute() were never designed to open APK files directly. I didn't even know that this was possible. The implementation of those commands didn't change in Hollywood 8.0 but of course the target Android API level had to be raised which means that some things might behave differently. I'll investigate what's causing this.
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Change in How Run() and Execute() Work in Android

Post by PEB »

Thanks for looking into this.

I've experimented with trying to use Run() and Execute() to call Android's built-in package installer; but I haven't had any success so far. (It seems like that should be possible, though.)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Change in How Run() and Execute() Work in Android

Post by airsoftsoftwair »

So the reason why this didn't work any more were, once again, new security restrictions introduced with Android 7.0. I've fixed it now but the result is that when installing the Hollywood Player, the user needs to explicitly allow it to install other apps. That's why it's disabled in the Hollywood APK Compiler because it doesn't make sense to activate it for all apps because then every app compiled by the Hollywood APK Compiler would ask for permission to install other apps which could be quite confusing. You can activate it manually, though.

Code: Select all

- Fix [Android]: Execute() and Run() can now be used to install APKs again; note that when using the
  Hollywood APK Compiler you need to request the "REQUEST_INSTALL_PACKAGES" permission via the manifest
  because by default apps can't install other apps and it doesn't make sense to generally request this
  permission for all apps because very few will actually need this
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Change in How Run() and Execute() Work in Android

Post by PEB »

With the Professional Edition, can this be achieved right now by adding the following line to the manifest?
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Change in How Run() and Execute() Work in Android

Post by airsoftsoftwair »

Unfortunately not. It also needs a fix in the Hollywood runtime itself. However, since an update for the APK Compiler is to be released soon, you won't have to wait too long for this to work...
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Change in How Run() and Execute() Work in Android

Post by airsoftsoftwair »

APK Compiler 3.1 has just been released. If you include this line in the manifest...

Code: Select all

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
...Run() and Execute() should be able to open APK packages.
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Change in How Run() and Execute() Work in Android

Post by PEB »

Thanks for adding that feature!

Does this require the use of PermissionRequest() with a new constant?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Change in How Run() and Execute() Work in Android

Post by airsoftsoftwair »

PEB wrote: Fri Jun 14, 2019 10:53 pm Does this require the use of PermissionRequest() with a new constant?
No, that's not necessary. Just put it in the manifest and it should work.
Post Reply