我为一个 flex 项目开发了一个 .ane 扩展。ane 扩展仅适用于 android,基本上它会启动一个 android 活动。问题是当应用程序启动时它会崩溃。我设法在我的手机上查看了日志,我看到 adobe air 抱怨说找不到在 flex 应用程序描述符文件中添加的一些 android 权限(权限已添加到我的 air-app.xml 中)。
许可的一个例子是:
<permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
这是我的 air-app.xml:
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
<!--Removing the permission android.permission.INTERNET will have the side effect
of preventing you from debugging your application on your device-->
<uses-permission android:name="android.permission.INTERNET"/>
<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
<!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
<!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
<!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together
in order to access AIR's SystemIdleMode APIs-->
<!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
<!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
<!--<uses-permission android:name="android.permission.CAMERA"/>-->
<!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
<!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled
together in order to use AIR's NetworkInfo APIs-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.motorola.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.motorola.dlauncher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.fede.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.lge.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="org.adw.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.motorola.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.motorola.dlauncher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.lge.launcher.permission.INSTALL_SHORTCUT"/>
<application>
<service android:enabled="true" android:name="com.apperhand.device.android.AndroidSDKProvider"/>
<meta-data android:name="com.startapp.android.DEV_ID" android:value= "112455740"/>
<meta-data android:name="com.startapp.android.APP_ID" android:value= "212206131"/>
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity android:name="com.apperhand.device.android.EULAActivity "
android:theme="@android:style/Theme.Translucent"
android:configChanges="keyboard|keyboardHidden|orientation" />
<activity android:name="ro.waystudios.startappextension.StartAppActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>
]]></manifestAdditions>
这是我的安卓活动代码:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidSDKProvider.initSDK(this);
}
这是我的调用函数:
Intent startActivityIntent = new Intent(context.getActivity(), StartAppActivity.class);
context.getActivity().startActivity( startActivityIntent );
有人可以告诉我 flex 中是否允许所有来自 android 的权限?