dalvik

How exactly does JVM differ from Dalvik and/or ART?

有些话、适合烂在心里 提交于 2020-01-21 01:44:50
问题 Firstly, I think I may have titled this question poorly, but I couldn't think of the right words, so please, feel free to suggest an edit and I will make it, so that the question is more educational and relevant to others. I know that javax.Swing simply cannot be used for an Android project, and I've accepted this and learned Android XML based UI design, but just out of curiosity, I want to know exactly why . I realize that the screen dimensions of a phone might be something Swing wouldn't

How can I configure a SAX parser in the Sun JVM to match the Android one?

浪尽此生 提交于 2020-01-16 05:06:28
问题 Is there a way to configure features/properties on the SAX parser so that it matches the default Android one? I have implemented a SAX parser for an Atom feed and I'd like to be able to unit test it without running it via an InstrumentationTestCase. The differences I see right away is that in startElement(), localName has the element name when running on Android, yet the "name" method parameter is populated when running under the Sun JVM. In addition, whitespace is ignored when running on the

How can I configure a SAX parser in the Sun JVM to match the Android one?

倖福魔咒の 提交于 2020-01-16 05:06:11
问题 Is there a way to configure features/properties on the SAX parser so that it matches the default Android one? I have implemented a SAX parser for an Atom feed and I'd like to be able to unit test it without running it via an InstrumentationTestCase. The differences I see right away is that in startElement(), localName has the element name when running on Android, yet the "name" method parameter is populated when running under the Sun JVM. In addition, whitespace is ignored when running on the

How can I configure a SAX parser in the Sun JVM to match the Android one?

懵懂的女人 提交于 2020-01-16 05:06:05
问题 Is there a way to configure features/properties on the SAX parser so that it matches the default Android one? I have implemented a SAX parser for an Atom feed and I'd like to be able to unit test it without running it via an InstrumentationTestCase. The differences I see right away is that in startElement(), localName has the element name when running on Android, yet the "name" method parameter is populated when running under the Sun JVM. In addition, whitespace is ignored when running on the

DVM instance creation per activity or application

北慕城南 提交于 2020-01-14 06:40:34
问题 For Android, each application has its own instance of DVM or each activity of an application has its own DVM instance i.e. the instance of DVM is created based on the application or activity? 回答1: Generally, each process has its own Dalvik VM. Since normally each application runs in a single process, all activities share the Dalvik VM for that process. There are more complicated scenarios (one app spread across N processes, N apps sharing one process), but those are very unusual in

Possible BUG in Android ImageDownloader class : sHardBitmapCache NOT static when it should be? [closed]

会有一股神秘感。 提交于 2020-01-12 05:45:19
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I have been trying to learn as much as possible about Android development with specific focus on performance since many apps in the Play store today are

OutOfMemory error though free memory is available

有些话、适合烂在心里 提交于 2020-01-12 03:13:25
问题 I'm seeing a pretty odd problem. Essentially sometimes large bitmap memory allocations will fail even though there's apparently tons of memory. There are a number of posts that appear to ask a similar question but they are all related to pre-honeycomb android. My understanding is that images are allocated on heap now, instead of some outside memory. Anyway, please look at this log below: 10-14 13:43:53.020: INFO/dalvikvm-heap(31533): Grow heap (frag case) to 40.637MB for 942134-byte

Double checked locking in Android

青春壹個敷衍的年華 提交于 2020-01-11 17:08:14
问题 According to many, the somewhat common Double-Checked Locking idiom is broken for java unless you're running 1.5 or later and use the volatile keyword. A broken double-checked lock sample: // Broken multithreaded version // "Double-Checked Locking" idiom class Foo { private Helper helper = null; public Helper getHelper() { if (helper == null) synchronized(this) { if (helper == null) helper = new Helper(); } return helper; } // other functions and members... } The sample comes from this

What's the best way to learn Smali (and how/when to use Dalvik VM opcodes)?

╄→尐↘猪︶ㄣ 提交于 2020-01-10 06:13:25
问题 I know Java, and learned C but never used it. I do not know any form of assembly, either for a virtual machine or a real one. What's the best way to learn how to hack Smali? 回答1: UPDATE: As I promised yesterday, I added some more links to the list. Ufff. Not much documentation around! Best advice? Decompile, and read, and tweak, and see how it did, and start the cycle again and again. But you did not ask for that advice, right? ;) Now, there are a few places out there that wil lhelp a little

Is checking SDK_INT enough or is lazy loading needed for using newer android APIs ? Why?

南笙酒味 提交于 2020-01-09 11:26:12
问题 Code such as : if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) ed.apply(); else ed.commit(); produces a warning in Froyo : 04-27 03:40:35.025: W/dalvikvm(3138): VFY: unable to resolve interface method 219: Landroid/content/SharedPreferences$Editor;.apply ()V But I understand that in older devices this would be a RuntimeError which would abort the application (see here and here). So is this way of conditionally calling new API (methods) safe in API 8 (Froyo) and above