【问题标题】:Android + Stage3D - empty screenAndroid + Stage3D - 空屏
【发布时间】:2012-07-10 00:01:20
【问题描述】:

我正在尝试弄清楚如何使用 Adob​​e Air 为 Android 编写应用程序。我选择了 Axel Framework(基于 Stage3D 的简单游戏引擎)和 FlashDevelop 作为我的工具。我写了我的第一个应用程序,它应该在屏幕上显示图像和一些文本。当我在桌面模式下运行这个应用程序时,它可以工作。不幸的是,当我在 Android 模拟器上安装它时,它只显示空白屏幕(在 [SWF] 标签中指定颜色)。我真的不知道怎么了。

其他编译参数: -swf-version=13

目标框架: AIR mobile 3.3

application.xml

<?xml version="1.0" encoding="utf-8"?>
<application xmlns="http://ns.adobe.com/air/application/3.0">

<id>air.TestAndroidAxl</id>
<versionNumber>0.1</versionNumber>
<supportedProfiles>mobileDevice</supportedProfiles>
<filename>TestAndroidAxl</filename>
<name>TestAndroid_Axl</name>

<android>
    <manifestAdditions><![CDATA[<manifest android:installLocation="auto">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-feature android:required="true"android:name="android.hardware.touchscreen.multitouch" />
    </manifest>]]></manifestAdditions>
    </android>

<initialWindow>
     <title>TestAndroid_Axl</title>
     <content>TestAndroidAxl.swf</content>
     <visible>true</visible>
     <fullScreen>false</fullScreen>
     <!--<autoOrients>false</autoOrients>-->
     <!--<aspectRatio>landscape</aspectRatio>-->
     <renderMode>direct</renderMode>
     <systemChrome>standard</systemChrome>
     <aspectRatio>landscape</aspectRatio>
 </initialWindow>

<icon>
    <image48x48>icons/icon_48.png</image48x48>
    <image57x57>icons/icon_57.png</image57x57>
    <image72x72>icons/icon_72.png</image72x72>
    <image114x114>icons/icon_114.png</image114x114>
    <image512x512>icons/icon_512.png</image512x512>
 </icon>
 </application>

Main.as

import flash.desktop.NativeApplication;
import flash.events.Event;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;

public class Main extends Sprite {

    public function Main() : void {
        stage.scaleMode = StageScaleMode.NO_SCALE;
        stage.align = StageAlign.TOP_LEFT;
        stage.addEventListener(Event.DEACTIVATE, deactivate);

        // touch or gesture?
        Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

        // entry point
        var game : AxlGame = new AxlGame();
        addChild(game);
    }

    private function deactivate(e:Event) : void {
        NativeApplication.nativeApplication.exit();
    }

}

AxllGame.as

import org.axgl.Ax;

public class AxlGame extends Ax {

    public function AxlGame() {
        super(PlayState);
    }

}

【问题讨论】:

    标签: android flash air adobe emulation


    【解决方案1】:

    您可能想在带有 GPU 仿真的模拟器上试用它。设置方法如下:

    1. 添加 Android 4.0.3(或更高版本)映像。
    2. 编辑图像。在“硬件:”旁边,选择“新建...”
    3. 添加“GPU 仿真”。
    4. 将其值设置为“是”。

    【讨论】:

    • 我在 logcat 中发现了一些有趣的东西:W/ActivityManager(82):没有找到用于权限撤销的内容提供者:file:///data/local/tmp/TestAndroidAxl.apk W/ActivityManager(82) :未找到内容提供程序以撤销权限:file:///data/local/tmp/TestAndroidAxl.apk I/PackageManager(82):删除非系统包:air.air.TestAndroidAxl I/ActivityManager(82):强制停止包 air.air.TestAndroidAxl uid=10044
    • 我发现错误是由 stage3D.addEventListener(ErrorEvent.ERROR, ...);但我无法修复它。
    猜你喜欢
    • 2012-03-29
    • 1970-01-01
    • 2012-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-06
    • 2011-04-19
    • 2013-04-21
    相关资源
    最近更新 更多