[Android]如何在Android(API 23)中加载swf文件 [英] [Android]How to load swf file in Android (API 23)

查看:146
本文介绍了[Android]如何在Android(API 23)中加载swf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android中加载swf文件,但似乎Android不支持swf.
我用google搜索,大多数开发人员建议使用webview:

I want to load swf file in Android , but it seems that Android don't support swf.
I google it,and most of developers suggest to use webview:

WebSettings settings = webview.getSettings();
settings.setPluginsEnabled(true);
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.loadurl("....swf");

但是在Api级别23中,setPluginsEnabled已删除,并且不赞成使用setPluginState.

but setPluginsEnabled was removed and setPluginState is deprecated in Api level 23.

推荐答案

但Android似乎不支持swf"

"but it seems that Android don't support swf"

是的,正如您所知... Adob​​e停止在移动浏览器上允许Flash Player.相反,他们建议您仅在应用程序中打开FlashPlayer内容,因为.. drumroll ... Adob​​e具有自己的工具他们自己的工具创建Android应用,只有它们的工具允许在移动应用中打开SWF.

Yes and as you've been told... Adobe stopped allowing Flash Player on mobile browsers. They instead recommend that you open FlashPlayer content within an app only because.. drumroll... Adobe have their own tool to create Android apps and only their tool allows opening SWF within a mobile app.

要注意的是,任何加载到应用程序中的SWF文件都无法运行自己的代码(对头脑不好的人来说,这可能是不安全的代码).因此,下一件最好的事情是使用Flash自己的StageWebView打开一个嵌入了Flash的html页面,所有内容都可以像在计算机浏览器上一样完美运行(仅这次是通过Flash制作的Android应用的StageWebView部分).

The catch is that any SWF loaded into an app cant just run its own code (could be un-safe code from a bad-minded person). So the next best things is to use Flash's own StageWebView to open a html page that has a flash embed and everything runs perfectly like on a computer browser (only this time via that StageWebView part of your Flash-made Android app).

要回答..

我想在Android中加载swf文件

I want to load swf file in Android

只需下载最新的 Flash CC (开发者工具包),然后通过ActionScript-3代码(而不是Java代码)重新创建您的应用.它们都是类似C的语言(尽管我觉得AS3在API名称等方面比Java更接近C#,但是您可以看到Java/Android在何处具有"

simply download the latest Flash CC (dev toolkit) and re-create your app through ActionScript-3 code instead of Java code. They are both C-like languages (though I feel AS3 is closer to C# than Java in terms of API names etc but as you can see where Java/Android has "WebView" well AS3 has "StageWebView" so it might not be that hard to switch for this app (if important enough to justify learning a new OOP language)

这篇关于[Android]如何在Android(API 23)中加载swf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆