Polybios in android

Discuss PDF file handling with the Polybios plugin here
sashapont
Posts: 87
Joined: Thu Aug 03, 2017 2:49 pm

Polybios in android

Post by sashapont » Fri Jun 15, 2018 9:55 pm

Is it work on android?

If I write @REQUIRE "polybios"
App is not start :(
Plugin for armeabi-v7a
Android 4.0.4

User avatar
airsoftsoftwair
Posts: 2607
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Polybios in android

Post by airsoftsoftwair » Sat Jun 16, 2018 10:14 pm

Please post LogCat output of what Hollywood says when it tries to load the plugin.

sashapont
Posts: 87
Joined: Thu Aug 03, 2017 2:49 pm

Re: Polybios in android

Post by sashapont » Sun Jun 17, 2018 12:23 am

How I can do it on android?
When I try to start applet I only see black screen.

User avatar
airsoftsoftwair
Posts: 2607
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Polybios in android

Post by airsoftsoftwair » Sun Jun 17, 2018 12:22 pm

1. Connect your Android device to your PC
2. Start LogCat from a console like this: "adb logcat"
3. Start Hollywood on the Android device
4. Watch the LogCat output. Hollywood will log something like this:

Code: Select all

Hollywood 7.1 [Android] [64-bit] (c) by Andreas Falkenhahn
The Cross-Platform Multimedia Application Layer
 
Loading plugin polybios.hwp...
Preparing display...done
And Action!
Post this output here. Actually, I only need what it says in the "Loading plugin polybios.hwp" line. It should log an error.

sashapont
Posts: 87
Joined: Thu Aug 03, 2017 2:49 pm

Re: Polybios in android

Post by sashapont » Mon Jun 18, 2018 4:48 pm

I/LogTag (27369): Loading plugin polybios.hwp...
I/LogTag (27369): failed
I/LogTag (27369): (Reason: Cannot load plugin: Cannot load library: reloc_library[1285]: 2037 cannot locate 'rand'...
I/LogTag (27369): )

User avatar
airsoftsoftwair
Posts: 2607
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Polybios in android

Post by airsoftsoftwair » Fri Jun 22, 2018 3:23 pm

Ok, looks like Polybios requires at least Android 5.0. I forgot to mention this in the documentation. Unfortunately, supporting earlier Android versions isn't possible because they miss some functions required by Polybios.

sashapont
Posts: 87
Joined: Thu Aug 03, 2017 2:49 pm

Re: Polybios in android

Post by sashapont » Fri Jun 22, 2018 9:34 pm

it is very sad :(
How I can check android version and preload Polybios if they>5?

User avatar
airsoftsoftwair
Posts: 2607
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Polybios in android

Post by airsoftsoftwair » Fri Jun 22, 2018 10:50 pm

You can just load Polybios with LoadPlugin() and if that fails you know you have Android < 5 :-)

User avatar
jPV
Posts: 173
Joined: Sat Mar 26, 2016 11:44 am
Location: RNO
Contact:

Re: Polybios in android

Post by jPV » Sat Jun 23, 2018 2:25 pm

BTW. I just came up with a problem when I try to use LoadPlugin instead of @REQUIRE on MorphOS.

If I do:

Code: Select all

LoadPlugin("polybios")
doc = pdf.CreateDocument()
doc:SetCompressionMode(#HPDF_COMP_ALL)     
I get an error: Constant not found!

So it doesn't recognize the #HPDF_COMP_ALL constant when I've loaded the plugin with the LoadPlugin function, but it does work if I change LoadPlugin to @REQUIRE.... what's wrong here? I'd like to load the plugin only if needed in this case...

User avatar
airsoftsoftwair
Posts: 2607
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Polybios in android

Post by airsoftsoftwair » Sun Jun 24, 2018 12:38 pm

jPV wrote:
Sat Jun 23, 2018 2:25 pm
BTW. I just came up with a problem when I try to use LoadPlugin instead of @REQUIRE on MorphOS.

If I do:

Code: Select all

LoadPlugin("polybios")
doc = pdf.CreateDocument()
doc:SetCompressionMode(#HPDF_COMP_ALL)     
I get an error: Constant not found!

So it doesn't recognize the #HPDF_COMP_ALL constant when I've loaded the plugin with the LoadPlugin function, but it does work if I change LoadPlugin to @REQUIRE.... what's wrong here? I'd like to load the plugin only if needed in this case...
Well, constants are evaluated at preprocessor level and at that time #HPDF_COMP_ALL obviously isn't there because the plugin is loaded at runtime. So using constants made available by plugins can be a little tricky, but the following should work:

Code: Select all

doc:SetCompressionMode(GetConstant("#HPDF_COMP_ALL"))

Post Reply