Questions tagged [dalvik]

Dalvik is a virtual machine used by Google's Android operating system.

From Wikipedia:

Dalvik is the process virtual machine (VM) in Google's Android operating system. [...] Programs are commonly written in Java and compiled to bytecode. They are then converted from Java Virtual Machine-compatible .class files to Dalvik-compatible .dex (Dalvik Executable) files before installation on a device. The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed. [...]

A tool called dx is used to convert some (but not all) Java .class files into the .dex format. Multiple classes are included in a single .dex file. Duplicate strings and other constants used in multiple class files are included only once in the .dex output to conserve space. Java bytecode is also converted into an alternative instruction set used by the Dalvik VM.

1028 questions
56
votes
5 answers

Is a Dalvik virtual machine instance created for each application?

Is a Dalvik virtual machine instance created for each application, or all Android applications share the same Dalvik virtual machine instance?
Rockystech
  • 3,016
  • 2
  • 16
  • 10
50
votes
2 answers

Difference between dexopt and dex2oat?

Google is moving from Dalvik to ART(Android Runtime). I was trying to understand, how it is going to improve the performance. The best explanation I found is the below image: One of the main component which has changed is dexopt to dex2oat. Since I…
Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126
47
votes
4 answers

Dalvik VM & Java Memory Model (Concurrent programming on Android)

I am working on Android projects which involve the lot of concurrent programming and I am going to implement some custom inter-threads communication stuff (the one from java.util.concurent are not well suited for my purposes). The concurrent…
Alexey Kryshen
  • 1,067
  • 2
  • 11
  • 15
44
votes
2 answers

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

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
ajma
  • 12,106
  • 12
  • 71
  • 90
42
votes
2 answers

Using Proguard with Android without obfuscation

I am getting an error "Conversion to Dalvik format failed with error 1" when using the -dontobfuscate flag. Otherwise my app exports fine. I don't want to obfuscate because I am using BugSense for error tracking and they charge $99 a month if you…
theJosh
  • 2,894
  • 1
  • 28
  • 50
41
votes
3 answers

Plugins architecture for an Android app?

THIS QUESTION HAS MOVED TO https://softwarerecs.stackexchange.com/questions/27841/plugins-architecture-for-an-android-app I want to implement a plugin system for an Open Source app, because it has become really large, with many features that only a…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
40
votes
4 answers

What is difference between DVM and ART ? Why DVM has been officially replaced with ART in Lollipop?

Since Android Lollipop, Google has replaced DVM with ART because ART is faster than DVM. Is there any other reason for that?
Amit Prajapati
  • 13,525
  • 8
  • 62
  • 84
39
votes
1 answer

Does Android plan to support Java7?

As Android does not currently support java7, I find myself wondering if they have made an official comment if they are working on supporting it?
pgsandstrom
  • 14,361
  • 13
  • 70
  • 104
39
votes
6 answers

How can I detect the Android runtime (Dalvik or ART)?

Google added a new ART runtime with Android 4.4. How can I determine whether ART or Dalvik is the current runtime?
Chris Lacy
  • 4,222
  • 3
  • 35
  • 33
37
votes
2 answers

JRE on Android

This might sound like a stupid question, but google didn't help me. Is there a JRE available for Android? If so which version is it? Are there any major features missing? If not does that mean all java apps need to be recompiled for Dalvik to work…
hhafez
  • 38,949
  • 39
  • 113
  • 143
36
votes
1 answer

Do Dalvik VM Processes Release System RAM?

The Android developer documentation, as part of Project Svelte (motto: "You ever try fitting Bugdroid into skinny jeans?!?"), has a page on Managing Your App's Memory. It contains: When the user navigates to a different app and your UI is no longer…
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
35
votes
3 answers

Android Process Scheduling

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…
Gregg Rivinius
  • 775
  • 1
  • 8
  • 13
35
votes
6 answers

During export of signed app, eclipse crashes

I have an android application that I exported a signed version perfectly on March 17, 2013. Then on March 19, 2013 I updated the Facebook SDK and Android SDK Manager, then tried to export my a signed version of my app again. First mistake. Now I've…
LJWilliamsIV
  • 1,164
  • 9
  • 13
33
votes
2 answers

Why is JUnit 4 on Android not working?

as the documentation of Android says, "Note that the Android testing API supports JUnit 3 code style, but not JUnit 4." (Testing Fundamentals). It should be clear that JUnit 4 cannot be used out of the box with Android. But why is this the case? Is…
Matthew
  • 816
  • 1
  • 7
  • 10
33
votes
1 answer

How to load a Java class dynamically on android/dalvik?

I'm wondering if and how one can load dex or class files dynamically in dalvik, some quick'n'dirty test function I wrote was this: public void testLoader() { InputStream in; int len; byte[] data = new…
anselm
  • 792
  • 1
  • 8
  • 21
1
2
3
68 69