android-runtime

Difference between dexopt and dex2oat?

允我心安 提交于 2019-11-28 16:12:28
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 don't have much idea about these, can anyone explain the difference and how this is going to improve the performance? dexopt does some optimizations on the dex file. It does things like replacing a virtual invoke instruction with an optimized version that includes the vtable index of the method being called, so that it doesn't have to perform a

Load DEX file dynamically on Android 5.0

房东的猫 提交于 2019-11-28 09:49:18
Prior to Android 5.0 I was able to load DEX files dynamically using DexClassLoader and calling loadClass() method but with the latest Android version I get a ClassNotFoundException . Here is what I am doing: Generate DEX file. ../android-sdk/android-sdk-linux_86/build-tools/21.1.1/dx --dex --output=bin/output.dex bin/output.jar Create a DexClassLoader. DexClassLoader cl = new DexClassLoader( dexFile.getAbsolutePath(), odexFile.getAbsolutePath(), null, mContext.getClassLoader()); Call cl.loadClass("myMethod"); I am aware that ART uses dex2oat to generate an ELF file that is the loaded by ART

Marshmallow permission implementation

寵の児 提交于 2019-11-27 22:49:59
I am trying to add Android 6.0 support in my Existing Android App. I have used SYNCADAPTER to sync data. its working fine till API 22. but in 23 (ANDROID 6.0) they have remove Group permission AUTHENTICATE_ACCOUNTS . I found sample how to get run-time permission , I tried same with AUTHENTICATE_ACCOUNTS but it is not working. I also found one answer , Is there any trick to use AUTHENTICATE_ACCOUNTS same as that answer? i found removed permissions list overhere . so if my app use that permission which is listed. in that case does any app works in Android M (6.0)? There is no longer need

Load DEX file dynamically on Android 5.0

折月煮酒 提交于 2019-11-27 03:14:14
问题 Prior to Android 5.0 I was able to load DEX files dynamically using DexClassLoader and calling loadClass() method but with the latest Android version I get a ClassNotFoundException . Here is what I am doing: Generate DEX file. ../android-sdk/android-sdk-linux_86/build-tools/21.1.1/dx --dex --output=bin/output.dex bin/output.jar Create a DexClassLoader. DexClassLoader cl = new DexClassLoader( dexFile.getAbsolutePath(), odexFile.getAbsolutePath(), null, mContext.getClassLoader()); Call cl

Marshmallow permission implementation

廉价感情. 提交于 2019-11-26 21:11:25
问题 I am trying to add Android 6.0 support in my Existing Android App. I have used SYNCADAPTER to sync data. its working fine till API 22. but in 23 (ANDROID 6.0) they have remove Group permission AUTHENTICATE_ACCOUNTS . I found sample how to get run-time permission, I tried same with AUTHENTICATE_ACCOUNTS but it is not working. I also found one answer, Is there any trick to use AUTHENTICATE_ACCOUNTS same as that answer? i found removed permissions list overhere. so if my app use that permission