- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有几个 web 应用程序,我希望能够通过 native android 应用程序中的 webview 运行。我目前正在嵌入人行横道浏览器并在其中加载应用程序。它适用于某些 Web 应用程序,但随着 Web 应用程序大小的增加,我收到导致我的 Android 应用程序崩溃的错误。
我尝试过的事情:
仍然有一些 Web 应用程序(通过 unity 创建)在我创建它们用于桌面测试时需要分配大约 1Gb。我将在最新的手机上使用这个 android 应用程序,并且可以接受如此高的内存使用率。
如果我尝试在桌面浏览器上打开此应用程序,它会起作用,这让我相信这是一个内存分配问题。我正在使用启用了 webGL 的人行横道 17,较小的应用程序运行 webgl 也很好。
我有几个问题:
这里是stack overflow用户常见问题解答:)
XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.mycompany.myproject.webapplicationActivity">
<org.xwalk.core.XWalkView
android:id="@+id/xwalkWebView"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
/>
</RelativeLayout>
创建时的 Activity :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webapplicationActivity);
xWalkWebView=(XWalkView)findViewById(R.id.xwalkWebView);
// turn on debugging
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
xWalkWebView.setKeepScreenOn(true);
xWalkWebView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
String urlToBeLoaded = "http://www.google.com";
Bundle bundle = getIntent().getExtras();
if (savedInstanceState == null) {
Bundle extras = getIntent().getExtras();
if(extras == null) {
Log.i(TAG,"error in reading extras");
} else {
urlToBeLoaded = extras.getString("url");
}
}
xWalkWebView.load(urlToBeLoaded, null);
权限
*Crosswalk 需要很多这些,我正在使用其余部分。但也许那里有冲突。
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
亚行日志
GL : validate_display:255 error 3008 (EGL_BAD_DISPLAY)
02-17 18:11:55.862 23023 23023 W art : Attempt to remove non-JNI local reference, dumping thread
02-17 18:11:55.903 4335 4448 I ActivityManager: Displayed com.mycompany.myProject/.GamePlayActivity: +464ms
02-17 18:11:55.904 23023 23023 W cr.BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 23023
02-17 18:11:55.904 22463 22463 I Keyboard.Facilitator: onFinishInput()
02-17 18:11:55.931 23023 23023 E chromium: [ERROR:layer_tree_host_impl.cc(2121)] Forcing zero-copy tile initialization as worker context is missing
02-17 18:11:55.980 4335 4448 I WindowManager: Screen frozen for +541ms due to Window{f87dd7b u0 com.mycompany.myProject/com.mycompany.myProject.GamePlayActivity}
02-17 18:11:57.987 4335 4448 I art : Starting a blocking GC Explicit
02-17 18:11:58.205 4335 4448 I art : Explicit concurrent mark sweep GC freed 12393(780KB) AllocSpace objects, 5(100KB) LOS objects, 23% free, 52MB/68MB, paused 1.298ms total 216.765ms
02-17 18:11:58.206 4335 15896 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@3b6394f attribute=null, token = android.os.BinderProxy@d44f10a
02-17 18:11:58.726 23023 23023 I chromium: [INFO:CONSOLE(1)] "Decompressed Release/StuntRunner_WebGL.memgz in 254ms. You can remove this delay if you configure your web server to host files using gzip compression.", source: https://<source>/Release/UnityLoader.js (1)
02-17 18:11:59.103 22037 22037 I ServiceManager: Waiting for service AtCmdFwd...
02-17 18:11:59.663 23023 23023 I chromium: [INFO:CONSOLE(1)] "Decompressed Release/StuntRunner_WebGL.jsgz in 853ms. You can remove this delay if you configure your web server to host files using gzip compression.", source: https://<source>/Release/UnityLoader.js (1)
02-17 18:11:59.985 23023 23023 I chromium: [INFO:CONSOLE(1)] "optimizing out Math.fround calls", source: https://<source>/Release/UnityLoader.js (1)
02-17 18:12:00.103 22037 22037 I ServiceManager: Waiting for service AtCmdFwd...
02-17 18:12:01.104 22037 22037 I ServiceManager: Waiting for service AtCmdFwd...
02-17 18:12:02.105 22037 22037 I ServiceManager: Waiting for service AtCmdFwd...
02-17 18:12:03.105 22037 22037 I ServiceManager: Waiting for service AtCmdFwd...
02-17 18:12:03.174 4335 22386 D NetlinkSocketObserver: NeighborEvent{elapsedMs=775340136, 192.168.1.1, [100D7F6DFA6E], RTM_NEWNEIGH, NUD_REACHABLE}
02-17 18:12:04.106 22037 22037 W Atfwd_Sendcmd: AtCmdFwd service not published, waiting... retryCnt : 5
02-17 18:12:10.387 4335 6452 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ id=842, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], android.os.BinderProxy@82c1e86)
02-17 18:12:10.392 4335 6549 I ActivityManager: Process com.instagram.android (pid 14465) has died
02-17 18:12:10.409 4335 5621 D ConnectivityService: releasing NetworkRequest NetworkRequest [ id=842, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
02-17 18:12:10.504 4335 5621 E ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=842, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
02-17 18:12:10.781 23023 23263 F libc : Fatal signal 4 (SIGILL), code 1, fault addr 0xd3781358 in tid 23263 (Chrome_InProcRe)
02-17 18:12:10.886 3293 3293 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-17 18:12:10.887 3293 3293 F DEBUG : Build fingerprint: 'google/angler/angler:6.0.1/MMB29P/2473553:user/release-keys'
02-17 18:12:10.887 3293 3293 F DEBUG : Revision: '0'
02-17 18:12:10.887 3293 3293 F DEBUG : ABI: 'arm'
02-17 18:12:10.887 3293 3293 F DEBUG : pid: 23023, tid: 23263, name: Chrome_InProcRe >>> com.mycompany.myProject <<<
02-17 18:12:10.887 3293 3293 F DEBUG : signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0xd3781358
02-17 18:12:10.933 3293 3293 F DEBUG : r0 d5366044 r1 40005000 r2 0855d000 r3 02182000
02-17 18:12:10.933 3293 3293 F DEBUG : r4 d5366044 r5 40000000 r6 00000000 r7 00000000
02-17 18:12:10.933 3293 3293 F DEBUG : r8 40005000 r9 d66d4050 sl 40000000 fp d66bee10
02-17 18:12:10.934 3293 3293 F DEBUG : ip f70ff624 sp d66bed40 lr d3dfa5e1 pc d3781358 cpsr 80030030
02-17 18:12:10.938 3293 3293 F DEBUG :
02-17 18:12:10.938 3293 3293 F DEBUG : backtrace:
02-17 18:12:10.926 3293 3293 W debuggerd: type=1400 audit(0.0:9681): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=1150 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=0
02-17 18:12:10.938 3293 3293 F DEBUG : #00 pc 001e3358 /data/app/com.mycompany.myProject-1/lib/arm/libxwalkcore.so
02-17 18:12:10.938 3293 3293 F DEBUG : #01 pc 0085c5dd /data/app/com.mycompany.myProject-1/lib/arm/libxwalkcore.so
02-17 18:12:11.276 3293 3293 W debuggerd: type=1400 audit(0.0:9682): avc: denied { read } for name="kgsl-3d0" dev="tmpfs" ino=1150 scontext=u:r:debuggerd:s0 tcontext=u:object_r:gpu_device:s0 tclass=chr_file permissive=0
02-17 18:12:11.817 4335 23497 W ActivityManager: Force finishing activity com.mycompany.myProject/.GamePlayActivity
02-17 18:12:11.818 3293 3293 F DEBUG :
02-17 18:12:11.818 3293 3293 F DEBUG : Tombstone written to: /data/tombstones/tombstone_05
02-17 18:12:11.818 3293 3293 E DEBUG : AM write failed: Broken pipe
02-17 18:12:11.890 4335 22149 I OpenGLRenderer: Initialized EGL, version 1.4
02-17 18:12:11.987 4335 5717 D GraphicsStats: Buffer count: 4
02-17 18:12:11.989 4335 5980 I WindowState: WIN DEATH: Window{def3a97 u0 com.mycompany.myProject/com.mycompany.myProject.LibraryActivity}
02-17 18:12:11.994 4335 5709 I WindowState: WIN DEATH: Window{9ffe3af u0 com.mycompany.myProject/com.mycompany.myProject.LoginActivity}
02-17 18:12:11.996 4335 4351 I WindowState: WIN DEATH: Window{ee84425 u0 com.mycompany.myProject/com.mycompany.myProject.GameDescriptionActivity}
02-17 18:12:11.999 4335 7252 I WindowState: WIN DEATH: Window{a09b55b u0 SurfaceView}
02-17 18:12:12.001 4335 5717 I WindowState: WIN DEATH: Window{f87dd7b u0 com.mycompany.myProject/com.mycompany.myProject.GamePlayActivity}
02-17 18:12:12.022 3309 3309 I Zygote : Process 23023 exited due to signal (4)
02-17 18:12:12.024 4335 28075 I ActivityManager: Process com.mycompany.myProject (pid 23023) has died
02-17 18:12:12.073 4335 28075 I ActivityManager: Start proc 23507:com.mycompany.myProject/u0a179 for activity com.mycompany.myProject/.GameDescriptionActivity
02-17 18:12:12.076 23507 23507 I art : Late-enabling -Xcheck:jni
提前致谢!
最佳答案
我遇到过这样的问题。我认为这个问题来自于 adsense 之类的广告,或者一些 JavaScript 出了问题
尝试
xwalk Release 'org.xwalk:xwalk_core_library:21.51.546.7'
希望对你有帮助
关于android - 嵌入式 Crosswalk 增加了 Android 上分配的内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35472398/
我最近在/ drawable中添加了一些.gifs,以便可以将它们与按钮一起使用。这个工作正常(没有错误)。现在,当我重建/运行我的应用程序时,出现以下错误: Error: Gradle: Execu
Android 中有返回内部存储数据路径的方法吗? 我有 2 部 Android 智能手机(Samsung s2 和 s7 edge),我在其中安装了一个应用程序。我想使用位于这条路径中的 sqlit
这个问题在这里已经有了答案: What's the difference between "?android:" and "@android:" in an android layout xml f
我只想知道 android 开发手机、android 普通手机和 android root 手机之间的实际区别。 我们不能从实体店或除 android marketplace 以外的其他地方购买开发手
自Gradle更新以来,我正在努力使这个项目达到标准。这是一个团队项目,它使用的是android-apt插件。我已经进行了必要的语法更改(编译->实现和apt->注释处理器),但是编译器仍在告诉我存在
我是android和kotlin的新手,所以请原谅要解决的一个非常简单的问题! 我已经使用导航体系结构组件创建了一个基本应用程序,使用了底部的导航栏和三个导航选项。每个导航选项都指向一个专用片段,该片
我目前正在使用 Facebook official SDK for Android . 我现在正在使用高级示例应用程序,但我不知道如何让它获取应用程序墙/流/状态而不是登录的用户。 这可能吗?在那种情
我在下载文件时遇到问题, 我可以在模拟器中下载文件,但无法在手机上使用。我已经定义了上网和写入 SD 卡的权限。 我在服务器上有一个 doc 文件,如果用户单击下载。它下载文件。这在模拟器中工作正常但
这个问题在这里已经有了答案: What is the difference between gravity and layout_gravity in Android? (22 个答案) 关闭 9
任何人都可以告诉我什么是 android 缓存和应用程序缓存,因为当我们谈论缓存清理应用程序时,它的作用是,缓存清理概念是清理应用程序缓存还是像内存管理一样主存储、RAM、缓存是不同的并且据我所知,缓
假设应用程序 Foo 和 Eggs 在同一台 Android 设备上。任一应用程序都可以获取设备上所有应用程序的列表。一个应用程序是否有可能知道另一个应用程序是否已经运行以及运行了多长时间? 最佳答案
我有点困惑,我只看到了从 android 到 pc 或者从 android 到 pc 的例子。我需要制作一个从两部手机 (android) 连接的 android 应用程序进行视频聊天。我在想,我知道
用于使用 Android 以编程方式锁定屏幕。我从 Stackoverflow 之前关于此的问题中得到了一些好主意,并且我做得很好,但是当我运行该代码时,没有异常和错误。而且,屏幕没有锁定。请在这段代
文档说: android:layout_alignParentStart If true, makes the start edge of this view match the start edge
我不知道这两个属性和高度之间的区别。 以一个TextView为例,如果我将它的layout_width设置为wrap_content,并将它的width设置为50 dip,会发生什么情况? 最佳答案
这两个属性有什么关系?如果我有 android:noHistory="true",那么有 android:finishOnTaskLaunch="true" 有什么意义吗? 最佳答案 假设您的应用中有
我是新手,正在尝试理解以下 XML 代码: 查看 developer.android.com 上的文档,它说“starStyle”是 R.attr 中的常量, public static final
在下面的代码中,为什么当我设置时单选按钮的外观会发生变化 android:layout_width="fill_parent" 和 android:width="fill_parent" 我说的是
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 9
假设我有一个函数 fun myFunction(name:String, email:String){},当我调用这个函数时 myFunction('Ali', 'ali@test.com ') 如何
我是一名优秀的程序员,十分优秀!