Common codebase for mobile and web applications?

I’ve been developing a mobile application for some time. It works on iOS and Android, as well as on the desktop as an AIR application. This is great and I am very excited about it. However, last week I was asked why I cannot export a version of the application running in a web browser. I said that I suggested that I could, and that I would look into it.

But why do you want to run mobile code on your desktop?

A few reasons:

  • Greater code reuse . This does not make sense in all cases, but it is in many cases. (I will not understand, because I think it goes without saying. If you do not agree that I would be glad to talk about it, but I would prefer not to stick this description).
  • Quick / easy customer demos . Instead of installing apk or ipa on a mobile device, I can just send the url.

So what have I found? Well, from what I have tried so far .. this .. does not work. Rather, I could not get it to work.

I started by creating a Flex library project for all the common code. Then I created 2 application projects that link to it: one for mobile and one for the Internet. The mobile project works fine, but the web project does not. Here is what I have tried so far to get it working:

  • mobilecomponents.swc mobile.swc -, Flash Builder MobileSkin ( - ). , , UIComponent: VerifyError: Error #1014: Class flash.text::StageText could not be found. , , ( --swf-version=13), .
  • , , : MobileSkin SparkSkin. , , . , . , MobileSkin SparkSkin, , . - b'c, (, layoutContents), , .
  • MobileSkin UIComponent , , MobileSkin, , UIComponent . (, layoutContents, DefaultWidth/measuredDefaultHeight, addChild vs addElement ..). , UIComponent "getState". (, MobileSkin , UIComponent.)

, ... , ? ? , - , , ? , .


:

: mobilecomponents.swc mobile.swc -

, Flash Builder . SWC " " : Swc '/Applications/Adobe Flash Builder

4.6/sdks/4.6.0/frameworks/themes/Mobile/mobile.swc , , . , swc, . SWC -.

, "", . - SWC " ". Flash Builder, , , ( ).

, . , " ", -. Flash Builder , . , , ! , (, List doens't scroll), !

+5
1

-

TextInput skinClass="spark.skins.mobile.TextInputSkin" StageText

FlashPlayer StageText AIR

+3

All Articles