Shared codebase for both mobile and web applications?

I have developed a mobile application for a while now. It works on iOS and Android, as well as on the desktop as an AIR application. That's great and I'm very excited about it. However, last week asked me why I could not export a version of the application that had occurred within a web browser. I said that I assumed I could and I'd look into it.

But why would you want to run mobile code on the desktop?

Two reasons:

  • A greater code reuse. This is not sensible in all cases, but it does in many case. (I will not elaborate because I think that this goes without saying.) If you do not agree I'd be happy to talk but I would rather not clog this description with it).
  • Demos of client quick or easy. Rather than having to install an apk or an ipa on a mobile device, I can just send a URL.

So what I found? Well, from what I've tried so far... He... does not work. Or rather, I was not able to make it work.

I started by creating a Flex library for all shared code project. Then I created 2 application projects referring to a TI - one mobile and one for the web. The mobile project works very well, but the web project does not work. Here is what I tried so far to make it work:

  • I tried to add mobilecomponents.swc and mobile.swc to my web project theme that Flash Builder knows MobileSkin (and other mobile classes only). This allows my application to compile, but when I run it immediately throws a runtime within UIComponent error: VerifyError: Error #1014: flash. text::StageText of the class could not be found. I have found very little on this errorand the one tip that I found (addition of the -swf-version = 13 the compiler option) does not work.

  • I tried to use conditional compilation to control which my skin inherited from the class components: MobileSkin or SparkSkin. It was just a quick experiment to see if it worked. I know it's disgusting and not a production solution. However, my thought was that if MobileSkin was really just an optimized version of SparkSkin, my skins should be correct inheriting from either. It worked not far-app wouldn't compile b ' c right some methods were absent (e.g. layoutContents) and so I bailed out on it because she felt dirty first.
  • I tried to replace MobileSkin with UIComponent as the super class for all my skins thinking MobileSkin was probably just a lightweight subclass of UIComponent anyway. This approach resulted in the compiler errors first (e.g. no method of layoutContents measuredDefaultWidth/measuredDefaultHeight properties, addChild vs addElement, etc.). Once these issues have been resolved in the updated app, but crashed with errors of execution within the method 'getState' of UIComponent. (Resembles MobileSkin overrides this method to prevent the default behavior of UIComponent.)

If none of these approaches worked for me so far... but what for you guys? I have no hope Adobe reading this thread or respond in some way, but I'd like to hear from others in the community. Have you encountered this problem yet? Have you been able to make it work or can you spot any obvious omissions that I made in the methods I mentioned above by train? Thanks in advance if you can.

Update: I was able to make progress with the first route above: added mobilecomponents.swc and mobile.swc for my web project theme

It turns out that this Flash Builder, had brought me wrong in that regard. Adding mobile SWCs to your library with the parameter "merged into code" project translates the compiler warning:

The swc "/ Applications/Adobe Flash Builder 4.6/sdks/4.6.0/frameworks/themes/Mobile/mobile.swc ' a default style and is located in the path of the library, i.e. the dependencies will be linked in without styles.  This can cause applications that use the swc output to have lack of skins.  The EFA should be implemented with external-library-path.

Seeing this the first time, I changed my link on "External" type and warning went off. Then in my project web, I also added the mobile SWCs and set the type to link on "merged into code" it. Flash Builder seemed happy with that approach, but when running my application I had weird errors (as mentioned above).

It turns out that my first attempt was the right way. Set the type of link on the library to "merged into code" project and then do not add a link to your web project. Flash Builder will warn you in this topic but ignore the warning. Things seem to work pretty well most of the time now! I have a question or two to watch (ex. list component doesn't scroll) but things look pretty promising overall!

Tags: Adobe AIR

Similar Questions

  • E-mail from both perspectives and web links open my homepage

    I have 8.1 of Windows and Outlook 2013. Without my doing anything I know, e-mail from both perspectives and web links open my home page, not the link of the e-mail?

    Hello

    Thanks for posting your question on the Microsoft Community forums

    Please answer the following questions to know more about the issue that you are facing:

    1. What web browser do you use? Are you facing this problem in Internet Explorer?

    2. You did changes in the settings of Internet Explorer before the show?

    Please follow the method to solve the problem might be that you are facing the problem in the browser because of some Add - ons, if you use Internet Explorer follow the link to manage add-ons

    http://Windows.Microsoft.com/en-us/Internet-Explorer/Manage-Add-ons#IE=ie-11-win-7

    Also follow the link to choose applications that Windows uses by default

    http://Windows.Microsoft.com/en-us/Windows-8/choose-Programs-Windows-uses-default

    Hope this helps

    Thank you

  • How can I make the biscuit and then break for both sides and have a few small pieces?

    Hello

    Please tell me...

    How can I make the biscuit in AE and then break for both sides and has a few small chips fall?

    any help would be so appreciated...

    Strictly within EI, you have two options. Breaking with custom maps shatter and masking + particle effects. Wouldn't conviceing as Dave.

    If you have access to a 3D application (blender is free) you can do it here.

    This is a project of 2 minutes in AE with a stock image:

    with one broken high buscuit animated to adjust to the split, it might be unconvincing.

    Here's the project CS6 ASP file for you to play with. Take a look at all the elements to see how it worked by selecting all layers, then pressing the key u twice to see what I changed.

  • Code 8024200 D Windows Update has encountered an unknown error. I get this message for both updates and windows failed to install.

    Code 8024200 D Windows Update has encountered an unknown error.  I get this message for both updates and windows failed to install. Can someone help me?

    Hello SammyFlo,

    Take a look at the following thread:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_other-windows_update/getting-a-Windows-Update-error-80070490-when/1f53aa2e-238C-488C-a952-cef7c9b7cc87

    Let us know if that helps.

    Best regards

    Matthew_Ha

  • How is it, my original keyboard does not work on my desktop, but works on my laptop? And my keyboard works for both laptop and desktop?

    Hello

    I have a desktop computer Windows 7 Home Premium 64-bit with an ASUS M4A87TD EVO motherboard. Recently, I have a problem with my Wired Saitek Eclipse PZ30AU keyboard: when I type, the typical button does not appear on the screen. In other words, the keys are unresponsive. The keyboard is turned on, if the office is enabled/disabled. Even if, at the time, while he was working, the light is always disabled whenever the office is off. I don't know why it is informed, even if the office is off.

    My wired mouse usb works fine. I even tried my USB adapter for wireless network in two USB ports, and I still have the signal, so I guess it works very well too. The on-screen keyboard works.
    However, I tried to connect the keyboard desktop on my laptop and for some reason, what works. I also tried to use a different keyboard on my desk, and it actually works.
    I downloaded the chipset, the driver M4A87TD EVO BIOS 2001 driver and a driver of NEC Electronics Corporation USB 3.0 controller. But first, I had to install the Akamai NetSession Interface. After that I downloaded all three files, I installed the chipset driver and USB driver in uncompressing them, by clicking on each file, by clicking on Setup. For some reason, the BIO 2001 pilot had only a ROM file, so I just deleted total. After installing and restarting the computer, the keyboard does not.
    I want to emphasize that, before even manually, download the drivers, I tried using WIndows Update to install all important and recommended updates. After the computer restarts, the guarded keyboard lights flashing on and outside.
    So, I ask two things:
    1.) how does my original keyboard does not work on my desktop, but works on my laptop? And my keyboard works for both laptop and desktop?
    2.) can I keep I have installed the drivers or uninstall them?
    Thank you.
     
    Original title: keyboard problem

    Hello

    This problem can occur because of incorrect keyboard layout settings.

    Please follow the instructions from the link and check that it works very well.

    Check out the link:

    Mouse, touchpad and keyboard with Windows problems

    http://Windows.Microsoft.com/en-us/Windows/help/Mouse-touchpad-keyboard-problems-in-Windows#V1H=tab05

    For all windows questions do not hesitate to contact us and we will be happy to help you.

  • Can I install ADOBE CC programs in both mobile and desktop? Although I'm sure that we can use only one at a time

    Can I install ADOBE CC programs in both mobile and desktop? Although I'm sure that we can use only one at a time

    Yes, I have it on my iMac and MacBook Pro.

  • I have the license for both I and ps is possible to use at the same time in the differren computers?

    I have the license for both I and ps is possible to use at the same time in the differren computers?

    Please see this FAQ for more information:

    FAQ: Can I install Creative Cloud on several computers?

  • A CS5/6 on the Mac at work, and then re-released a Windows laptop (which I have personal licenses for CS4 design and web), trying to find or decompress files of decent download to make a few changes

    A CS5/6 on the Mac at work, and then re-released a Windows laptop (which I have personal licenses for CS4 design and web), trying to find or decompress files of decent download to make a few changes... anyone got a ferrule or all links on where to go to decompress? The laptop Windows is for personal use and workload to work is too intense and also Mac licenses so no need for the House.

    It is not not clear from your post what you are looking for, but here's a general link for downloads for older versions of Adobe software.

    Other downloads

  • CUPS, Jabber IM for iPhone, Mobile and external access

    Hello world

    How do you provide external secure access for email Instant Jabber for iPhone client and the Cisco Mobile customer on an iPhone?

    There are so-called security SSL for Jabber Instant Messaging, but is unable to find all the information on how. The Cisco Mobile client appears to the needs of the AnyConnect VPN client and encourage users to connect via VPN, first...

    After a bit of bumping into a wall your head wondering why there was no documentation for external access to Cisco Jabber for iPhone, I realized that Cisco Jabber IM for iPhone is an entirely different product and Jabber for iPhone seems to be the new name of Cisco Mobile customers. Yet, the only documentation I can find for the Jabber Instant Messaging is that I can "security by using the Secure Sockets Layer (SSL) encryption" but no information on implimenting it with CUPS.

    On top of that, the Jabber IM for iPhone can not make calls but rather calls Cisco Mobile, which raises the question of providing external access to this too, and the only solution I've ever found is to use the AnyConnect VPN client on the device also. Suddenly, it seems to offer a solution of Cisco Unified Communications on an iPhone, I need three different and is applications is no longer quite as unified.

    Thank you

    Mark

    Conclusions you drew on the product names are correct. They are transitioning to Jabber like a brand name, but it did not in the iOS VoIP client yet. The most recent Cisco Jabber for Android is the first to include Secure Connect (remote access protected or ensure access transparent, aka). The BU seems characteristic knocking out on a single platform and then replicating them on others before moving on to the next batch of features. I don't have a specific timetable to share but expect customers to iOS updated in the coming months with Secure Connect.

    With regard to the separate clients: I can see both sides of this room. The more I use them more, I agree with the decision to keep them separated and cross-launch when necessary. If you think it is consistent with the way the user interacts already with their phone: voice and texting are two separate applications. I suspect that the developers also get some benefits by keeping things more targeted (e.g. less than test whenever they change something). The only downside to this approach is that each app consumes its own tunnel AnyConnect on the SAA.

  • Application of flow through Webgate and web application server

    I have a scenarios,

    There are two webgates on both web servers configured as a reverse proxy to an application. The doors of two web use external load balancer 1 (material). Two web portals are registered on two servers OAM (load balancing - logical web application server). The application is protected by OAM, and is set to launch a custom login page. The application web servers also use external load balancer 2.

    First, when the user tries to access the URL of the application, the flow would be:

    LoadBalancer1 - Web server with OAM WebGate - WebServer with WebGate (after successful authentication) - LoadBalancer2 (lettering) - server of web App - homepage

    Now, what happens if the user goes to another link within the app? The user will be routed to the loadbalancer 2 to the Web server with load balancer WebGate GOLD 2 to 1 load balancer, then to the Web server with WebGate. Please note that the web server with WebGate is configured as reverse proxy for the application. Sorry if I'm not able to articulate the situation clearly.

    Any thoughts?

    Thank you.

    Hello

    Allows to call the application URL app.mydomain.com. With the components you mentioned above, generally that would make a DNS change to point app.mydomain.com to 'loadbalancer1 '.

    Say so the user has already been authenticated and authorized and on the page of the application (app.mydomain.com/home.jsp). OAM is usually configured to protect web pages within an application. When the user clicks on 'Préférences' inside of home.jsp which is "app.mydomain.com/preferences.jsp", control would again go to loadbalancer1-> of the webgates.

    Hope that answers your question.

  • scanners and web applications

    Hello guys, how to implement a scan of a web application and the ability to preview the scanned (in the ADF application) before loading on the server. I mean by scanner (a device that scans the images, printed text) use JDev 12 c. Thanks in advance

    Thank you both, I found this http://www.dynamsoft.com html/js twain for web based applications that solved my problem :)

  • LIBRARY for both Flash and Flex

    Hi all

    I want to create a library of action scripts that I can use with both flash and flex. I understand how the if I want to just use it in flex, but I also want it compiles down into a swf or what so I can use the features in flash. I tried to create a library of action scripts, but it forces me to specify one "application executable file." which doesn't make much sense, since I want just a class library.

    Found the answer (sort of). It is only partially possible. The best way would be just to edit files in flex builder and not creating a real library (although this approach does not work if you need to distribute the library).

    To create a library, you must create a Flex library with flex builder project, not a library of action scripts. the action script library is a misnomer.

    Then, when you build you must pass through some obstacles to get it actually works, but create a manifest file and setting 'Informati-digest = false' as an option to the compiler. For more information, see the following blog:

    http://timwalling.com/2007/10/22/compiling-Flash-CS3-compatible-SWCs-with-Flex/

  • I can't loan my product key for my laptop and its application as it how can I get it or can I get a product key. thanks___

    • I cannot prepare my my laptop and its application product key, how can I get it or can I get onther use
    • I cannot prepare my my laptop and its application product key, how can I get it or can I get onther use

    You mean «you can not read my product key...» » ?
    If so, see if this tutorial can help you...

    How to see the Vista product key

    http://www.Vistax64.com/tutorials/85023-product-key-number.html

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • Best practices to configure NLB for Secure Gateway and Web access

    Hi team,

    I'm vworksapce the facility and looking for guidance on best practices on NLB with webaccess and secure gateway. My hosted environment is Hyper-v 2012R2

    My first request is it must be configure NLB, firstly that the role of set up or vice versa.

    do we not have any document of best practice to configure NLB with 2 node web access server.

    Hello

    This video series has been created for 7.5 and 2008r2 but must still be valid for what you are doing today:

    https://support.software.Dell.com/vWorkspace/KB/87780

    Thank you, Andrew.

  • A / B testing and reports industry for e-mail and Web site reference

    Is there any report of the industry in Eloqua for email and Web site?

    Arnaud - did you use the functionality of Eloqua dashboard? in Eloqua9, you can click on the black drop-down arrow next to the name of an e-mail and view the dashboard. You can also do this for groups of emails as well. There is a gauge out there that will give you an indication of how you compare to industry benchmarks.

Maybe you are looking for