use phonegaps deviceready event