dalvik

Android Process Scheduling

寵の児 提交于 2019-12-17 08:12:12
问题 I am trying to get a better understanding so I can scope the reliability impact from potential interoperability issues when creating an android app/service. I would like to figure out how process priority is determined. The differences in priority between services and activities and if the scheduler treats their priority differently. Basically I'm trying to get a strong understanding of how likely it is that an activity or service is starved by a rogue processes from a different application

OutofMemoryError: bitmap size exceeds VM budget (Android)

我们两清 提交于 2019-12-17 05:02:20
问题 Getting an Exception in the BitmapFactory. Not sure what is the issue. (Well I can guess the issue, but not sure why its happening) ERROR/AndroidRuntime(7906): java.lang.OutOfMemoryError: bitmap size exceeds VM budget ERROR/AndroidRuntime(7906): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:295) My code is pretty straight forward. I defined an XML layout w/ a default image. I try to load a bm on the SDCard (if present - it is). If not it shows the default image. Anyway..

Does the Android ART runtime have the same method limit limitations as Dalvik?

倾然丶 夕夏残阳落幕 提交于 2019-12-17 04:45:28
问题 Does the Android ART runtime have the same method limit limitations as Dalvik? Currently, there's a limit of 64k methods in the primary dex file 回答1: The issue is not with the Dalvik runtime nor the DEX file format, but with the current set of Dalvik instructions. Specifically, the various method invocation methods, which look like this: invoke-kind {vC, vD, vE, vF, vG}, meth@BBBB B: method reference index (16 bits) You can reference a very large number of methods in a DEX file, but you can

Unable to execute dex: GC overhead limit exceeded in Eclipse

大兔子大兔子 提交于 2019-12-17 03:46:19
问题 When I downloaded the Git project OsmAnd and went to compile it, Eclipse returned these errors: [Dex Loader] Unable to execute dex: GC overhead limit exceeded [OsmAnd] Conversion to Dalvik format failed: Unable to execute dex: GC overhead limit exceeded Google and Stackoverflow said that I must change -Xms40m -Xmx384m in eclipse.ini . Conversion to Dalvik format failed: Unable to execute dex: Java heap space. I cleaned project and restarted Eclipse, but it did not help. I found this link:

Unable to execute dex: GC overhead limit exceeded in Eclipse

纵饮孤独 提交于 2019-12-17 03:46:01
问题 When I downloaded the Git project OsmAnd and went to compile it, Eclipse returned these errors: [Dex Loader] Unable to execute dex: GC overhead limit exceeded [OsmAnd] Conversion to Dalvik format failed: Unable to execute dex: GC overhead limit exceeded Google and Stackoverflow said that I must change -Xms40m -Xmx384m in eclipse.ini . Conversion to Dalvik format failed: Unable to execute dex: Java heap space. I cleaned project and restarted Eclipse, but it did not help. I found this link:

外部JAR上的“到Dalvik格式的转换失败,错误1”

别等时光非礼了梦想. 提交于 2019-12-15 20:54:18
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在Eclipse中的Android应用程序中,出现以下错误。 超出预期的最高级别: java.lang.IllegalArgumentException:已添加:Lorg / xmlpull / v1 / XmlPullParser; .... 转换为Dalvik格式失败,错误1 仅当我向项目中添加特定的外部JAR文件时,才会出现此错误。 我搜索了很长时间以寻找可能的解决方案,但是所有可能的解决方案都无效。 我什至尝试更改为Android 1.6而不是1.5(我使用的当前版本)。 #1楼 我发现了其他东西。 Android使用 /libs 目录存储JAR文件。 我无数次看到“向Dalvik格式转换失败并出现错误1”错误,总是在我的JAR文件中出现错误时出现。 现在,通过将新的JAR文件放在 /libs 目录中,并将类路径切换到新版本,我将Roboguice升级到了新版本。 这导致了Dalvik错误。 当我从 /libs 文件夹中删除Roboguice JAR文件之一时,错误消失了。 显然,Android会从 /libs 拾取所有JAR文件,无论您在Java构建路径中指定了哪个文件。 我记不清了,但是我认为Android默认从 Android 4.0 (Ice Cream Sandwich,ICS)开始使用

Dalvik虚拟机与java虚拟机的区别

家住魔仙堡 提交于 2019-12-14 16:32:06
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1.java虚拟机运行的是Java字节码,Dalvik虚拟机运行的是Dalvik字节码;传统的Java程序经过编译,生成Java字节码保存在class文件中,java虚拟机通过解码class文件中的内容来运行程序。而Dalvik虚拟机运行的是Dalvik字节码,所有的Dalvik字节码由Java字节码转换而来,并被打包到一个DEX(Dalvik Executable)可执行文件中Dalvik虚拟机通过解释Dex文件来执行这些字节码。 2.Dalvik可执行文件体积更小。SDK中有一个叫dx的工具负责将java字节码转换为Dalvik字节码。 3.java虚拟机与Dalvik虚拟机架构不同。java虚拟机基于栈架构。程序在运行时虚拟机需要频繁的从栈上读取或写入数据。这过程需要更多的指令分派与内存访问次数,会耗费不少CPU时间,对于像手机设备资源有限的设备来说,这是相当大的一笔开销。Dalvik虚拟机基于寄存器架构,数据的访问通过寄存器间直接传递,这样的访问方式比基于栈方式快的多. 来源: oschina 链接: https://my.oschina.net/u/920274/blog/2992534

Dalvik to Java SE communications

我们两清 提交于 2019-12-14 04:18:01
问题 I'm planning on developing an app for android that requires a back-end server to sync data with other users of the app. I'm planning on writing this server in standard java running on a unix server. I once did this directly between two android devices, in that case I just serialized all the data needed to be sent on both ends. However I suspect that the format that Dalvik serializes to and Java SE's format are not compatible. Is this the case? And if it is, what are my alternatives? One thing

How to return a static result in smali function

泄露秘密 提交于 2019-12-14 03:58:48
问题 .method public c()Ljava/lang/String; .locals 3 const/4 v1, 0x0 const-string v0, "wifi" invoke-virtual {p0, v0}, Lcom/genwen/looltv/start/Appstart;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v0 check-cast v0, Landroid/net/wifi/WifiManager; if-nez v0, :cond_1 move-object v0, v1 :goto_0 if-eqz v0, :cond_2 invoke-virtual {v0}, Landroid/net/wifi/WifiInfo;->getMacAddress()Ljava/lang/String; move-result-object v0 if-eqz v0, :cond_0 const-string v1, ":" const-string v2

Programmatically, how to write an unoptimized code to calculate the sum of 10 integers?

自作多情 提交于 2019-12-14 03:27:01
问题 In Java, C, or C++, how to write an unoptimized code to calculate the sum of 10 integers (from 0 to 9) programmatically? For example, I use the following code but it is seems that both codes (the ones labeled as //Baseline and //Method #1) are optimized by the compiler at the compile time and the total variables are converted to constants before runtime. I confirmed that by comparing the time1 and time2 which are similar. My question is : Programmatically, how to sum the 10 numbers and force