Your code would always fire an alert and would fire a second alert if the localStorage is null (which according to your comment is). This does not mean that the deviceready Cordova event is fired twice. Can you elaborate if your problem is different, please elaborate what is the expected behavior and let us know which is your app, so we can take a look at it.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Missed our first webinar, watch it here.
Share feedback and vote for features on our Feedback Portal.