Skip to content

It's always in connecting to device #11

Description

@scott1028

I have installed cordova 3.4 and build my project.
Here are my steps:

1.npm install -gd cordova
2.cordova create myapp
3.cd myapp
4.cordova platform add android
5.cordova plugin add https://github.com/InQBarna/WebIntent.git

and then edit my file index.js to add follow these codes:

var app = {
    initialize: function() {
        this.bindEvents();
    },
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    onDeviceReady: function() {
        app.receivedEvent('deviceready');
    },
    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;');

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

        document.onclick=function(){
            alert(new Date);

            CDV.WEBINTENT.startActivity({
                    action: CDV.WEBINTENT.ACTION_VIEW,
                    url: 'geo:0,0?q=' + 'new york'}, 
                },
                function() {}, 
                function() {alert('Failed to open URL via Android Intent')};
            );
        }
    }
};

6.cordova run android

but my device always stop in "connecting to device" status.
I dont know how to make it work. Is it a issue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions