Return to site

android applications on multi-core processors performance - CodeShoppy

Paralleling source code is the most common approach to optimize the performance of Android applications on multi-core processors. However, the problem of selecting a good parallel structure and its parameter tube is still a challenge. This paper proposes the performance optimization method based on selecting the best parallel configuration including the parallel structure and corresponding parameter tube. Native C/C++ code of an Android application is analyzed to find parallel structures using OpenMP framework and parameter tubes of each parallel structure. The evaluation function is built to evaluate the performance of an Android application under parallel configuration. This function is implemented in an optimization program to select the best parallel configuration of the Android application.

An access to a LoadedApk instance while application is already running is an issue to be solved. The Application5class holds a reference to the LoadedApk instance; see source code 5 . At the same time, the Application instance is available from any activity with the aid of a getApplication() method. An mLoadedApk field of the LoadedApk type is annotated by“@hide”, thus the field is not a part of the public API. For our purpose this is an undesirable restriction.

broken image

Newly created RefChanger class is responsible for the change of the references to the ClassLoader and Resources instances in the LoadedApk class. The RefChanger instance isinitialized right after starting the application and only one instance exists here (it is a singleton). DynamicDexClassLoader is the second key class of the whole solution. This ClassLoader is responsible for loading of the classes of modules

When attempting to run particular module the application will look up a DynamicDexClassLoader instance (intended for loading this module) in a hash map. If it is found, then the reference in the LoadedApk instance is changed to this DynamicDexClassLoader, which loads classes from the module’s package. The reference to the Resources is changed in the same way. If there is no DynamicDexClassLoader in the hash map yet, it is created. After that, the DynamicDexClassLoader is put into the map for future reuse and the mentioned references are changed. Finally, an I ntentdefining the Activity to be run (ModuleActivity.class) is created and the Activity of the module is run.