How to include XML files on the Android device or into the APK compiler.

Please post anything related to the Hollywood APK Compiler here
Post Reply
Pierre55
Posts: 44
Joined: Sat Apr 01, 2017 4:25 pm

How to include XML files on the Android device or into the APK compiler.

Post by Pierre55 » Mon Mar 18, 2019 12:16 pm

Hi

I need to know how to include some .XML files to my Android device or maybe it's possible to include the files in the main program?

I have two lines in my code that need to be include .XML files.

moai.CreateDialog(FileToString("Edit.xml"), "win")
moai.CreateApp(FileToString("ExpoEditeur.xml"))

I did try to insert the TEXT like this

moai.CreateDialog(<?xml version="1.0" encoding="iso-8859-1"?> <dialog id="dlg" title="Ajouter un Article" width="300"> <vgroup> <colgroup columns="2"> <label># Item</label> <textentry id="item"/> <label>Nom</label> <textentry id="Nom"/> <label>Prix</label> <textentry id="Prix"/> <label># Exposant</label> <textentry id="Exp"/> </colgroup> <hgroup> <button id="ok">OK</button> <button id="cancel">Cancel</button> </hgroup> </vgroup> </dialog>
, "win")

but Hollywood failed to compile.

Thank you.

bitRocky
Posts: 105
Joined: Fri Nov 14, 2014 6:01 pm

Re: How to include XML files on the Android device or into the APK compiler.

Post by bitRocky » Mon Mar 18, 2019 3:11 pm

You have to do it this way:

Code: Select all

moai.CreateDialog([[<?xml version="1.0" encoding="iso-8859-1"?> <dialog id="dlg" title="Ajouter un Article" width="300"> <vgroup> <colgroup columns="2"> <label># Item</label> <textentry id="item"/> <label>Nom</label> <textentry id="Nom"/> <label>Prix</label> <textentry id="Prix"/> <label># Exposant</label> <textentry id="Exp"/> </colgroup> <hgroup> <button id="ok">OK</button> <button id="cancel">Cancel</button> </hgroup> </vgroup> </dialog>]], "win")

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

Re: How to include XML files on the Android device or into the APK compiler.

Post by airsoftsoftwair » Mon Mar 18, 2019 9:53 pm

Alternatively, you can do this:

Code: Select all

@FILE 1, "gui.xml"
moai.CreateApp(ReadString(1))
Using @FILE will automatically link the specified file to the applet/executable.

Pierre55
Posts: 44
Joined: Sat Apr 01, 2017 4:25 pm

Re: How to include XML files on the Android device or into the APK compiler.

Post by Pierre55 » Mon Mar 18, 2019 11:03 pm

Thank you very much, I'll try both solution.

Bye!

Pierre.

Pierre55
Posts: 44
Joined: Sat Apr 01, 2017 4:25 pm

Re: How to include XML files on the Android device or into the APK compiler.

Post by Pierre55 » Wed Apr 03, 2019 1:39 pm

Can I use this command to include RapaGUI plugin in my script?

Thank you.

Pierre

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

Re: How to include XML files on the Android device or into the APK compiler.

Post by airsoftsoftwair » Wed Apr 03, 2019 10:22 pm

You mean you want to link rapagui.hwp into your applet/executable? This isn't necessary on Android because Hollywood on Android has RapaGUI built in.

Pierre55
Posts: 44
Joined: Sat Apr 01, 2017 4:25 pm

Re: How to include XML files on the Android device or into the APK compiler.

Post by Pierre55 » Thu Apr 04, 2019 1:36 pm

Yes that's what I want... I was thinking for the others platform (Windows, OS4 and Mac)

Thank you.

Pierre

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

Re: How to include XML files on the Android device or into the APK compiler.

Post by airsoftsoftwair » Thu Apr 04, 2019 9:25 pm

Pierre55 wrote:
Thu Apr 04, 2019 1:36 pm
Yes that's what I want... I was thinking for the others platform (Windows, OS4 and Mac)
For those platforms you can just do:

Code: Select all

@REQUIRE "rapagui", {Link = True}

Post Reply