Porting from iOS to Android - first time issues...

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
PaulMaguire
Posts: 44
Joined: Wed Feb 13, 2013 3:38 pm
Location: Glasgow, Scotland
Contact:

Porting from iOS to Android - first time issues...

Post by PaulMaguire » Wed May 29, 2013 3:00 pm

Hi Androids.

First post here. I have an LC iOS app (v5.5.5, OSX) in review at Apple. While this was happening I had a naive notion that I would spend the review time tweaking for Android. I know, I know...

So here are my key issues - if anyone has some insight in how to address any of them I'd really appreciate any wisdom:

- I have web scroller native controls displaying content (images, styled text and links). In the iOS version the CSS is interpreted and displays fine. However, in Android, the text is not displaying the correct font. The font is included in the build and displays fine within the rest of the UI.

- I have been making the background of these native scrollers transparent by doing this:
mobileControlSet sBrowserId, "opaque", false
mobileControlSet sBrowserId, "backgroundColor", "0,0,0,0"
This works nicely in iOS but doesn't at all in Android. Is this possible in Android?

- I am pointing to a local asset within the HTML I am using for each scroller display. I'm using the specialFolderPath thus:
put (specialFolderPath("engine") & slash & "Media/footer.png") into tImageURL
put "<p><img src = "&QUOTE&tImageURL&QUOTE&" width = "&QUOTE&"50"&QUOTE&"></p>" into tS
Again, works in iOS, not in Android - missing.

- It's *extremely* slow when moving to eg. maps or graphic heavy menus (cards using multiple alpha elements with some minor glow effects). All media is embedded and preloaded. All glows are 'box1' and simple (switching these effects off has no significant effect). The panning map graphic I am using is large: 2048 x 1276 pix. I have the acceleratedRendering of the stack to TRUE. Are there any simple settings I'm not setting here to have it load and display in a reasonable time?

I'm a bit under pressure here to get this Android version wrapped asap so I'd really appreciate any help. Thanks!

Kind regards, Paul.

PaulMaguire
Posts: 44
Joined: Wed Feb 13, 2013 3:38 pm
Location: Glasgow, Scotland
Contact:

Re: Porting from iOS to Android - first time issues...

Post by PaulMaguire » Wed May 29, 2013 3:52 pm

The notes below seem wrong now sorry - I've tested on 2 devices with 2 different results. Sigh.
----
Update:

(I'm going to feed back here with some notes and any breakthroughs I may have for any future iOS to Android n00bs)

I see from the Android dev notes that 'backgroundColor' and 'alpha' are not supported in Android native controls (as well as many other features). But... I can make the background transparent through CSS by doing the following:
body{
background: rbg(0,0,0,0);
}
('code' styler in this editor seems broke in Chrome on MacOS - sorry)

-- actually I just found out I need to set the backgroundColor of the native control to 0,0,0,0 too for this to work. Whu? There is no mention of backgroundProperty in the Android dev notes.

So, anyways - great! 1 issue down, 273 to go...

Kind regards, Paul.

jekyllandhyde
Posts: 89
Joined: Thu Feb 14, 2013 7:17 pm

Re: Porting from iOS to Android - first time issues...

Post by jekyllandhyde » Fri Jun 21, 2013 1:32 am

Paul,

I wish I could help but I'm way behind you. I just had my iPhone App approved and have the following question: To keep development/conversion as simple as possible re: screen size and OS version issues, then what Android devices does one start development for? For IOS I chose iPhone 4 + and IOS 6.0+ because this is about 90% of the installed base. I really don't have a clue re: Android, it seems much more fragmented. I don't want to support screen sizes any less than 640x960.

Thanks in advance, Adam

PaulMaguire
Posts: 44
Joined: Wed Feb 13, 2013 3:38 pm
Location: Glasgow, Scotland
Contact:

Re: Porting from iOS to Android - first time issues...

Post by PaulMaguire » Mon Jun 24, 2013 12:01 pm

Hi.

I've just uploaded a version of my dual-platform app to Google Play. Porting to Android took me a lot longer than anticipated. Basically I spent most of my time trying to sort visual anomalies and quirks in different behaviour with the native controls for each platform. Some issues I cannot resolve (not sure if these are bugs or not - investigating). I plan to do a blab post of my experience of building my first app for iOS and Android in Livecode, as a gotcha list for others.

Regarding screen sizes: I developed my cross-platfrom app at 320x480 portrait-only. However - it was built using Chip Walters resizer tool which helps automate the tedious coding of scaling and repositioning all elements within a card. I did in fact write some of my own code to handle custom scenes - not especially complex, but tedious! In-app rescaling and assistance was a stretch goal of the Kickstarter campaign. So I'm hoping it is an issue which will go away.

320x480 seems small, but the trick is to build assets at twice the resolution and scale 50% - this keeps retina displays looking crisp if the stack doubles in scale. It's not perfect but it allowed me to get the job done and the results are good visually. Something to note - Chip advises setting the image quality to 'good' for every image using his rescaling tool. This is fine in iOS (minor hit in speed) but absolutely kills Android devices it seems. My only solution was to keep their quality as 'normal'.

Hope this helps.

Kind regards, Paul.

jim1001
Posts: 137
Joined: Fri Jan 29, 2016 6:25 pm

Re: Porting from iOS to Android - first time issues...

Post by jim1001 » Thu Oct 12, 2017 6:41 pm

I see from the Android dev notes that 'backgroundColor' and 'alpha' are not supported in Android native controls
Maybe this has changed since 2013 but according to the dictionary entry for mobileControlSet (Community v8.1.6) 'backgroundColor' and 'alpha' can be set for "All native mobile controls". I'm not sure which "Android dev notes" Paul is referring to. I couldn't see anything on this under https://livecode.com/resources/guides/mobile/

Anyway I've been trying to change 'backgroundColor' and 'alpha' for an Android player and having no success at all - has anyone else done it?

Thanks for any replies.

Post Reply

Return to “Android Deployment”