我想将Flextras(http://www.Flextras.com)制作的Mobile AutoCompleteCombobox包含到我的项目中,以便为用户提供快速填充某些textInput的方法。所以我在我的代码中成功地集成了它,我可以说,因为当我启动FlexBuilder的移动设备模拟器时结果很好:它启动我的应用程序代码来测试它包括组件(我使用了提供给源代码的示例代码) )。 在那次测试之后,我想要一个apk文件在真实的移动设备下测试这个应用程序。所以我成功构建了swf,最后是apk文件!但是当我在移动设备下启动它时,我的应用程序失败了:它在我的启动画面中无限时间冻结!你有没有见过这个问题,你甚至解决了这个问题?因为我在名为Stackoverflow.com的大型交流论坛中搜索过,但我找不到任何类似的问题!
请你能给我一个提高效率的方法吗? 以下几行是为了解释我方法的两个部分:首先编译swf Flex文件,然后构建apk安卓包。
1)使用cmd.exe控制台启动,编译:
ant -buildfile Build_myAppProject.xml actionCompiler
2)使用cmd.exe控制台启动,以构建应用程序文件:
adt -package -target apk -storetype pkcs12 -keystore [MyCertificateFile.p12] -storepass hyebiell1234 [MyOutputFile.apk] [MyAppInfoDescriptor.xml] [MyAppCompiledFile.swf] -extdir [MyANEAndLibrariesFolder] -C src \ assets -C src \ assets \ img -e src [MySqliteFileToCopyIntoPackage] [MySqliteFileToCopyIntoPackage] -e src \ icone50x50.png icone50x50.png -e src \ icone72x72.png icone72x72.png -e src \ icone128x128.png icone128x128.png -e src \ icone144x144.png icone144x144.png -e src \ icone512x512.png icone512x512.png
ant_build_myAppProject.xml:
<?xml version="1.0" encoding="utf-8"?>
<project name="Build_avec_4.11_AIR_4.0" basedir=".">
<property name="FLEX_HOME" value="c:/Program Files/Adobe/Adobe Flash Builder 4.5/sdks/4.11_AIR_4.0"/>
<property name="APP_ROOT" value="src"/>
<property name="ANE_DIR" value="extensions"/>
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/Ant/lib/flexTasks.jar"/>
<target name="actionCompiler">
<mxmlc
file="${APP_ROOT}/myAppProject.mxml"
output="${APP_ROOT}/myAppProject.swf"
locale="fr_FR"
static-rsls="true"
accessible="true"
configname="airmobile"
debug="false"
failonerror="true"
optimize="true"
maxmemory="512m"
swf-version="16"
>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${APP_ROOT}"/>
<compiler.external-library-path dir="${ANE_DIR}" includes="*.swc" append="true"/>
<library-path dir="${ANE_DIR}" includes="*.swc,*ane" append="true"/>
<library-path dir="${FLEX_HOME}/frameworks/locale/fr_FR" includes="*.swc" append="true"/>
<define name="CONFIG::device" value="false"/>
<define name="CONFIG::iphone" value="false"/>
<define name="CONFIG::android" value="true"/>
</mxmlc>
</target>
</project>
最近我用LogCat启动了应用程序,我得到了这个:
12-11 16:19:51.087: D/action(2224): android.intent.action.MAIN
12-11 16:19:51.158: D/cym(2224): cancelUnReadCount(ComponentInfo{air.PlanifVisites/air.PlanifVisites.AppEntry})
12-11 16:19:51.168: D/cym(2224): onInvokeApp(0)
12-11 16:19:51.188: I/ActivityManager(376): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=air.PlanifVisites/.AppEntry bnds=[129,38][240,197] u=0} from pid 2224
12-11 16:19:51.288: D/dalvikvm(376): GC_FOR_ALLOC freed 1533K, 37% free 9768K/15495K, paused 72ms, total 80ms
12-11 16:19:51.338: I/ActivityManager(376): Start proc air.PlanifVisites for activity air.PlanifVisites/.AppEntry: pid=4942 uid=10087 gids={3003, 1015, 1028}
12-11 16:19:51.398: I/Adreno200-EGLSUB(118): <CreateImage:893>: Android Image
12-11 16:19:51.398: I/Adreno200-EGLSUB(118): <GetImageAttributes:1158>: RGBX_8888
12-11 16:19:51.438: E/Trace(4942): error opening trace file: No such file or directory (2)
12-11 16:19:51.518: I/StartupTime1(4942): :1449847191530
12-11 16:19:51.538: D/dalvikvm(4942): Debugger has detached; object registry had 1 entries
12-11 16:19:51.698: D/dalvikvm(4942): Trying to load lib /data/data/com.adobe.air/lib/libstlport_shared.so 0x40e213e0
12-11 16:19:51.728: D/dalvikvm(4942): Added shared lib /data/data/com.adobe.air/lib/libstlport_shared.so 0x40e213e0
12-11 16:19:51.728: D/dalvikvm(4942): No JNI_OnLoad found in /data/data/com.adobe.air/lib/libstlport_shared.so 0x40e213e0, skipping init
12-11 16:19:51.728: D/dalvikvm(4942): Trying to load lib /data/data/com.adobe.air/lib/libCore.so 0x40e213e0
12-11 16:19:51.968: D/dalvikvm(4942): Added shared lib /data/data/com.adobe.air/lib/libCore.so 0x40e213e0
12-11 16:19:52.078: V/Sensors(376): int poll__setDelay(sensors_poll_device_t*, int, int64_t)
12-11 16:19:52.078: V/Sensors(376): int sensors_poll_context_t::setDelay(int, int64_t)
12-11 16:19:52.078: V/Sensors(376): int poll__setDelay(sensors_poll_device_t*, int, int64_t)
12-11 16:19:52.078: V/Sensors(376): int sensors_poll_context_t::setDelay(int, int64_t)
12-11 16:19:53.470: D/dalvikvm(4942): GC_CONCURRENT freed 3257K, 52% free 4080K/8451K, paused 3ms+2ms, total 62ms
12-11 16:19:53.520: D/StartupTime2(4942): :1449847193331
12-11 16:19:53.520: I/__BUILD_NO(4942): #15.0.0.349
12-11 16:19:53.780: I/Choreographer(4942): Skipped 104 frames! The application may be doing too much work on its main thread.
12-11 16:19:53.820: I/Adreno200-EGLSUB(118): <CreateImage:893>: Android Image
12-11 16:19:53.820: I/Adreno200-EGLSUB(118): <GetImageAttributes:1102>: RGBA_8888
12-11 16:19:53.820: I/ActivityManager(376): Displayed air.PlanifVisites/.AppEntry: +2s529ms
12-11 16:19:54.471: D/dalvikvm(4942): GC_FOR_ALLOC freed 468K, 55% free 3833K/8451K, paused 17ms, total 18ms
12-11 16:19:54.471: I/dalvikvm-heap(4942): Grow heap (frag case) to 13.438MB for 1463056-byte allocation
12-11 16:19:54.491: I/Choreographer(4942): Skipped 42 frames! The application may be doing too much work on its main thread.
12-11 16:19:54.501: I/Adreno200-EGLSUB(118): <CreateImage:893>: Android Image
12-11 16:19:54.501: I/Adreno200-EGLSUB(118): <GetImageAttributes:1158>: RGBX_8888
12-11 16:19:54.501: I/ggheart(2224): onStop
12-11 16:19:54.501: I/Test(2224): onStop
12-11 16:20:00.036: I/Adreno200-EGLSUB(118): <CreateImage:893>: Android Image
12-11 16:20:00.036: I/Adreno200-EGLSUB(118): <GetImageAttributes:1102>: RGBA_8888
感谢您的帮助。