1
votes

I have read a topic from here (Accessing native API/system from Sencha Touch). But it's not what i asking about.

I used the Sencha CMD to generate new Sencha Touch project and add cordova support to it. Finally I also use Sencha CMD to build my project.

Now I want to use some phonegap API/calling some Jave code. How do I do that ?

P/s: I see somebody add the cordova.js to the index.html source code to get phonegap support. But i use the Sencha CMD to add cordova support and build project. I don't see the file.

1
Sencha Cmd applications will automatically load cordova.jsarthurakay
@arthurakay Could you tell me where did you read this ? :D I need to learn more about things like this.user2916684
I just know it from experience. You should see it listed in your app.json file under "js" resources. Assuming you followed this: sencha.com/blog/leveraging-phonegap-within-sencha-toucharthurakay
I made it work :) And you right. THe cordova.js will be automatically load to the index.html When we working with Sencha CMDuser2916684

1 Answers

0
votes

Now I want to use some phonegap API/calling some Jave code. How do I do that ?

It depends on the individual PhoneGap plugin... but in the client application, it's all just JavaScript. You'll just follow whatever API documentation exists for the plugins you want to use.

Usually it's something like this (PushPlugin example):

pushNotification = window.plugins.pushNotification;

pushNotification.register(...)

So in the case of your Sencha Touch application, you'd just execute that code where appropriate.