Deployment issues. Differences between IDE, PC and Android

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Deployment issues. Differences between IDE, PC and Android

Post by Monox18 » Wed Mar 28, 2018 8:27 pm

Hi all,

I have troubles deploying an app to android smartphone. I have attached 2 screenshots. On the left is the IDE stack version. Middle is the PC deployed app. Right is the Android deployed app running on Bluestacks emulator. (Also Bluestacks app looks identical to my Android phone Meizu me2 when deployed)

My problem is that some scrollbars, button, texts and so on change a lot when deploying to Android, but remain 100% the same when deploying to PC. In my case I'm talking about field scrollbars, normal scrollbars, and radio buttons. Buttons have minor issues but they are easy to deal.

Everything was done in LiveCode 7, but today I opened it from LC 9 RC and Deployed to see if this would solve the problem. Same results.

What can I do to make my android app to look exactly like in IDE?

Thank you!
Attachments
Screenshot 2018-03-28 14.16.44.png
Screenshot 2018-03-28 14.15.12.png
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Deployment issues. Differences between IDE, PC and Android

Post by Monox18 » Fri Mar 30, 2018 12:46 am

Well it seems I can do nothing about. The closes thing I could find is the LookAndFeel property. http://livecode.wikia.com/wiki/LookAndFeel

Code: Select all

set the lookAndFeel to "Motif"
will show me the same controls that are being displayed on my phone. Changing this property won't work in the phone, it will crash the app. Also changing it in desktop will make it look horrible and won't let save as standalone.

It seems the only solution is to go for custom scrollbars and ratiobuttons...

on the other hand this post brought my attention https://livecode.com/using-infinite-liv ... ment-84042

anybody can explain how to use the widgets over there? specifically interested in the SeekBar.

Image
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Deployment issues. Differences between IDE, PC and Android

Post by jacque » Fri Mar 30, 2018 7:49 pm

The lookAndFeel property only applies to desktop environments and the Linux one is no longer accurate. If the OS isn't a recognized lookAndFeel you will get the very old Motif appearance by default, which is what you see on mobile.

To build native-looking controls in mobile you need to use the mobileControlCreate and mobileControlSet commands to get native appearance. This has been simplified for some controls in LC 9, where you can drag existing widgets to your stack for buttons and fields. More native control widgets will be added eventually but for now, drag an Android field to your stack and if the environment is "mobile", show the widget. The same is true for native push buttons.

There is currently no widget for radio buttons, but they will accept an icon. Import an image of an Android radio icon and assign the ID to the LC radio button.

LC is working to make mobile controls easier to use but for now it does require a little bit of developer management.

I haven't ever seen the incorrect placement of controls on the card, as your screenshot shows. I'm not sure what would cause that, unless you have some scripted geometry in place.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Deployment issues. Differences between IDE, PC and Android

Post by Monox18 » Sat Mar 31, 2018 7:53 pm

Ok, I'm working with the mobileControlCreate and mobileControlSet commands now.

About the incorrect placement, yes I manually adjust control positions in the resizeStack message. But something else happened. Although I was using controls from their default settings when dragged from the palette, they would look all messed up when deployed. So for example defaul textSize is 12 and some would look bigger and some smaller. So I had to make a code to explicitly say "set the textSize of blablah to 12", and it worked. At least controls look correctly placed. (just horrible motif scrollbars and radio buttons).
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Deployment issues. Differences between IDE, PC and Android

Post by jacque » Sat Mar 31, 2018 8:11 pm

The font issue is probably because Android has a different system font, and also because font size is an inherited property. If the text size is set, it will be used, otherwise it inherits from the field text size. And if that isn't set, it inherits from the card and then from the stack. To get the same font size everywhere, you can remove any specific sizes from text or their fields and just set the fontsize of the stack. Every field that doesn't have its own size assigned will use the stack's size.

It looks like you are on your way to a better looking app. I agree the Motif appearance is undesirable.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm
Location: Deggendorf, Germany

Re: Deployment issues. Differences between IDE, PC and Android

Post by Monox18 » Tue Apr 03, 2018 3:10 am

Yeah that worked. I set the textSize to the font and now the objects are properly inheriting the property. Now I know a little bit more of the inheriting system.

On another side, I have been using the mobileControlCreate comand for making input texts and replacing the ones I have for native mobile ones. Everything worked out but one thing. The messages system.

If I use mobileControlCreate "input", in a field control, and then refer to it with the ID, how do I get messages? The control that created the mobileControl is supposed to get the messages but I haven't been able to get any of the closeField, openField, exitField messages for text formatting. Code works on normal fields in PC but doesn't in mobile for mobile fields. I can of course write and read from/to the mobilecontrol but can't get it to fire messages. Any idea?
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Deployment issues. Differences between IDE, PC and Android

Post by jacque » Tue Apr 03, 2018 7:29 am

If you need those messages, you will probably have better luck using native field widgets in LC 9. They do respond to open/closefield messages and there is less scripting, too. Just drag one to your stack. They won't work on desktop but they do in mobile.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”