Take the 2-minute tour ×

I am new to phonegap and created my first android application running on an emulator . The output screen is garbled and i am not able to understand why . Also this is not showing the alert boxes on position chnages

code :

var app = {
    // Application Constructor
    initialize: function() {

    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);


    onDeviceReady: function() {


    receivedEvent: function(id) {

        var parentElement = document.getElementById(id);
        var listeningElement = parentElement.querySelector('.listening');
        var receivedElement = parentElement.querySelector('.received');

        listeningElement.setAttribute('style', 'display:none;');
        receivedElement.setAttribute('style', 'display:block;');

        //docuement.addEventListener('menubuttom', this.onMenuButton , false);

        console.log('Received Event: ' + id);
        alert("Manish: ");

        var options = {frequency: 9000};
        navigator.geolocation.getCurrentPosition(this.onSucess, this.onError ,options);


    onSucess: function(position){
        alert (" SUCESS");
        alert (position.coords.latitude);

    onError: function(errorCode){
        alert (" ERROR RECEIVED IN APP ");
        alert (errorCode.message);


the output image is (as you can see garbled ) + other alerts not comming enter image description here

[UPDATE]: After i turned off the flag android:hardwareAccelerated to false the garbled problem vanished . then i turned the android:hardwareAccelerated to true and the problem was not reproducible . I think for now i will leave it there . I would still love to hear what people might have soem expalanation to it . Currently I am not able to solve the "other alerts not coming" problem

share|improve this question

Your Answer



Browse other questions tagged or ask your own question.