AIR iOS load external swf ABC - almost succeeded - ios

I have an entire day of searching and testing behind me and I officialy think it's impossible. Yet there is left to share what I've accomplished and ask for any sugestions.
So I'm working on Flash Builder 4.7, AIR SDK 3.5 and iPad 3 iOS 6.0.1.
What I want is to have an ad-hoc application to load a swf file containing actionscript and add it to stage. I started by testing the application in debug mode on device connected by usb. Everything works well. Then I compiled an ad-hoc release build, which did not work that well. Graphics was added to stage but actionscript didn't run. I've started to search the web and found out that it was possible to load swf's packed in ipa that could run actionscript, but it is no more, though there was a link to the download page of that SDK version under "Where can I get the build?"
It didn't work. I included the second swf in export package contents. Did I do it wrong?
Anyway even if it worked what I actually need is to be able to download a swf from a server, save it in storage directory and then load it to the main application.
Is there maybe a way to tell iOS that the application it's running is a debug version (that's actually working), but it shouldn't display the popup with information about connecting to a debugger and it actually should run fast like a legit release build?

Unfortunately you can not load any code from any server to execute it. Apple forbids it. The only code that can be loaded from outside and executed on iOS is JavaScript within the built in WebKit browser (using UIWebView or in case of Air - StageWebView).
As of air 3.6 (which is still in beta) you can package additional swfs with your application for later loading with Loader class, but this feature is still severely limited compared to normal web swf loading - you are only allowed to load code to the same ApplicationDomain your application uses and you can not unload anything so it is just easier to link all the code to one swf statically using swc libraries for example and not bother with loading anything.

We've found that loading SWFs with ABC code in iOS can be done without any problem with Flash Builder 4.7 and AIR 3.6 SDK. At this time Adobe Flash Builder 4.7 comes with AIR 3.5 SDK, so you can download the last SDK version from here and install it into your Adobe Flash Builder sdks folder.

Related

How to embed Autodesk Forge Viewer with mobile app?

I was using ionic and angular to develop a mobile app that could display the pdf, image or dwg file within the forge viewer. It works all perfectly on the website monitor, but when I deploy the app in the ios phone and the android phone, I found out that if I open the dwg file and some image file, the app will crash sometimes. Btw, some extension is not supported by ios, such as pushpin extension. It seems that three js works not good in ios.
I also check the document about the "Create iPhone Apps Using Forge Viewer & React Native" in the forge viewer official website. After I follow the steps to build the app with native react and deploy it on my phone, pdf and image file works good but not for the dwg file.
I have experience building apps with ionic but not React Native. Compare to these two frameworks, which one should I pick? If I continue using the ionic framework if there is any way I could use to improve the performance of the forge viewer inside my app? or would it be better to switch to React Native?
For tech questions, how could I avoid the app crash and improve the performance? I checked the A360 app on the app store, I found out that the app is using the offline data, it will download all the data once it opens the file. Should I do the same way?
App Viewer
Technically both RN and Ionic embeds Viewer as external dependencies in WebView so there's no material difference/pros and cons in the approach to embed.
As such I'd recommend to go with the framework you are more comfortable/experienced with - although RN seems to be blessed with a couple of samples but those do little more than scratch the surface when it comes to a real world solution so you can get up to speed with their approach and go from there.
Performance wise yes - downloading the derivatives (SVFs) to the client side would certainly improve load times - you can either see here and here to download, store/package locally and override request handling of WebView to load them (as Viewer only supports http(s) and not file or other protocols) , or cache the resources with Service Worker following here and here.
You can look around SO for other performance related questions - mostly they are about setting the memory options, correct FPS targets, consolidating geometry, selective loading and adjusting navigation options - for specific issues you can post another question or email forge.help at autodesk.com for assistance.
It is okay to open the dwg file less than 1mb very soon, but if the file is larger than 1mb, it will take some time to load and is hard to zoom the viewer.
I'd suggest to download or cache the derivatives (SVF) locally to boost loading performance. I was unable to reproduce any difficulty with zooming - did you set viewport in head meta tag?

Issues with Xcode & Realm browser

So i've been trying to use Realm browser with Xcode so that it's easier for me to see and test my objects. But i seem to be running into a couple of problems with this.
The first issue is that with Realm Browser i'm not able to actually open up my files location using the dropdown option 'open common locations' so i can open it via the iPhone simulator. Even when i do open the file using alternative methods i keep on getting the following error in the console.
UserInfo = {
Error Code=8,
NSLocalizedDescription=Realm file is currently open in another process which cannot share access with this process. All processes sharing a single file must be the same architecture. For sharing files between the Realm Browser and an iOS simulator, this means that you must use a 64-bit simulator.
}
Which is weird because my Macbook is 64 bit since it's the Mid 2013 Macbook Air could anyone help solve this problem at all? Since it would make development so much easier if i could just use the browser application.
So i figured this out and realised that you have to be running the app using an iPhone 5s or higher
You are correct. Realm cannot be opened at the same time between processes of different architectures. iPhone 5 or earlier simulator is running as 32-bit process.

Do PhoneGap/Cordova Apps run under HTTP?

I'm coming behind another developer who built a PhoneGap/Cordova HTML 5 application, currently only targeting IOS. Admittedly, I have zero experience with Cordova and hybrid mobile apps.
I can open up the XCode IDE and run the application and I can see the web page (application) load up in the iPad emulator, so long as I have his Node.js application running.
I guess I'm confused about the context in which the actual index.html that makes up the HTML 5 application runs. Does it run on the iPad under a mini web server (http://local or http://localhost) or does the index.html run on a file system path (something like file://path-to-file/index.html)?
I've used Icenium (Telerik AppBuilder) and created an empty project for which I copied all the HTML 5 code into and ran it. Upon inspecting/debugging the page in the emulator, I see that the page is being served up with a base URL of http://local.
Lastly, I simply tried opening the index.html by double-clicking it and running it in the browser (file:///...builds/ios/www/index.html), and the application didn't work
In summary, as long as I run the website in an emulator, the application loads and runs file, but it won't run loading it from the file system.
My assumption is the scripts are expecting an http base URL and the file:/// url is throwing it off. Does this sounds like a reasonable explanation?
Do Cordova apps run the HTML 5 apps under HTTP?
Thank you.
they run on a file system path (something like file://path-to-file/index.html)
if you are using something from the phonegap API it won't work on a desktop browser

Prevent native video player in sencha touch 2

I'm building an app for iOS and android using sencha touch 2.3.1 (using sencha architect 3 as my IDE if that's useful to know) and I want to be able to play video inline, as opposed to an embedded video that opens up the native video player after the user taps on it. A perfect example of the functionality I'm after would be the Vine app (at least for iOS, I haven't looked at it on android), videos simply play right there on the page without the native iOS video player taking over.
I'm aware of the allowsInlineMediaPlayback property of UIWebView, but I have no clue how to set that, or even whether I can, since I'm not building a native app in xcode (in fact I have no experience doing so, this is my first attempt at building any sort of mobile application).
How do you plan to package your application to run on a mobile device? The html/js/css what you are creating needs to be packaged on some way to have a mobile app. You can use sencha cmd for that but phonegap is sort of more popular for that. If you will use phonegap then you can set this in the config.xml. See http://docs.phonegap.com/en/2.2.0/guide_project-settings_ios_index.md.html
I managed to get this working by installing cordova on my machine, then running the
sencha cordova init
command on my sencha project folder. After that I simply made sure allowsInlineMediaPlayback was set in my cordova config and that my video tag/object in Architect had the webkit-playsinline attribute set to "1".
If you're interested I am still able to continue my normal development and build workflow in Architect (Architect is now compatible with Cordova, though make sure you add
{
"path": "cordova.js",
"remote": true
}
to your app.json manually. Note you only need that entry in the js section of your app.json and DO NOT NEED THE ACTUAL CORDOVA.JS FILE TO BE IN YOUR PROJECT FOLDER, Architect will handle this when you run your build command).

Embed Adobe Air/Flex application inside a standard iOS application

I have a native (Obj-C, standard Xcode project) application and I'd like to integrate a partners iOS application (or specifically, it's functionality) into it as just another view in my application. The problem is that their application is a Flex/Air app. I really don't understand the Adobe compilation process on how it gets from a bunch of flex code down to an IPA. I don't see intermediate projects, shared objects, etc on the disk to produce that IPA. It looks like it doesn't rely on the Apple tool chain... as I understand it, you can produce the IPA on Windows as well.
Is there any way to build that Flex app in such a way that I can import it into Xcode so I can link against it and use it as a library from within my application?
While I specifically used iOS as an example since that is the most important platform, we'll want to apply this solution to our respective Android and Blackberry 6 apps as well.
No, you cannot embed an application within another application. This is true for all applications. Only thing you could do is get the swf of your partner's code and embed that into an Air application, but since you're not using Actionscript/Flex, it won't be possible.
Only other way would be to have an app link to the other application.

Resources