Refactored and moved javascript to androids file.