A method for using cloud computing for Android By: Collin Molnar
Summary ● Intro in Android ● Intro into computation offloading ● Problems with computation offloading ● Design Patterns ● Local & Remote Invocation ● On-Demand Remote Invocation ● Refactoring the code
Intro ● Android is open source ● More than 59% of smartphone market ● Limits – Battery Power – Size – Processing Power
Computation offloading Intro ● Some code can only run in a mobile device – GPS – Accelerometer – Sensors ● This is a way to reduce the limits of mobile devices ● Does come with problems
Problems ● Processing Time – Network Delay – Types of Networks – Adaptability ● These are solved by the on-demand computation offloading model
Design Pattern ● Android Apps – Coded in Java – Uses classes ● Classes use methods ● Three Design Patterns 1) Local invocation 2) Remote invocation 3) On-demand Remote Invocation
Local & Remote Invocation ● Local Invocation – Programs run on local processor ● Remote Invocation – Uses new set of classes and methods ● These classes alter code without changing requirements that allow them to run on remote servers
Remote Invocation ● Source Structure
On-Demand Remote Invocation ● Allows program to run on multiple VMs ● Also allows multiple protocols (4g, Wi-Fi) to change connection with the same server ● Two structures make up the core. – A proxy is used so program structure will not know if the server or connection is changed. – Proxy – a class used as an interface to something else.
On-Demand Remote Invocation ● The endpoint – Used to change VMs – Connects to the remote communication service – Runs as the crossing network for the program structure and MyService
Refactoring the Code ● 4 steps 1) Detect which type the classes are ● Two Types of classes ● Movable ● Anchored 2) Make movable classes off-loadable ● Structure is changed so it is able to process on remote server.
Refactoring the Code ● Steps 3) Detect which classes should be off loaded as a package. ● Classes that frequently interact should be off loaded a whole. ● Used to help increase speed ● 4) Package deployable files ● The Java byte code and resources are packaged and generated into two deployable files.
Conclusion ● Evaluated on 3 Android applications – Reduced execution time by 46%-97% – Reduced battery consumption 27%-83%
References Ying Zhang, Gang Huang, Xuanzhe Liu, Wei Zhang, Hong Mei, and Shunxiang Yang Refactoring android Java code for on-demand computation offloading. SIGPLAN Not. 47, 10 (October 2012),