Page 1 of 1

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

Posted: Mon Mar 18, 2019 12:16 pm
by Pierre55
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.

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

Posted: Mon Mar 18, 2019 3:11 pm
by bitRocky
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")

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

Posted: Mon Mar 18, 2019 9:53 pm
by airsoftsoftwair
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.

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

Posted: Mon Mar 18, 2019 11:03 pm
by Pierre55
Thank you very much, I'll try both solution.

Bye!

Pierre.

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

Posted: Wed Apr 03, 2019 1:39 pm
by Pierre55
Can I use this command to include RapaGUI plugin in my script?

Thank you.

Pierre

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

Posted: Wed Apr 03, 2019 10:22 pm
by airsoftsoftwair
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.

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

Posted: Thu Apr 04, 2019 1:36 pm
by Pierre55
Yes that's what I want... I was thinking for the others platform (Windows, OS4 and Mac)

Thank you.

Pierre

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

Posted: Thu Apr 04, 2019 9:25 pm
by airsoftsoftwair
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}