I am making an app in which if intensity of temperature goes below certain threshold it is supposed to trigger a twit function. I am aware of twitter API I have generated keys and all the things infect I have successfully run the JavaScript file through node.js and it was working fine, but I want to use that function in my html code (I am using visual studio 2015 cordova to develop an android app). In short I want to integrate those file that I downloaded from GitHub.com (package url : github.com/ttezel/twit, but keep in mind that these bunch of file has not plugin.xml file.). So, how can I use these file in cordova (or where to put these JS files in project library if it is the case and what changes I have to make inorder to successfully execute the app from android phone.).
Asked
Active
Viewed 36 times
1 Answers
0
So, how can I use these file in cordova (or where to put these JS files in project library if it is the case and what changes I have to make inorder to successfully execute the app from android phone.).
Migrating a node JS app to a cordova plugin is not a good idea. You will need to change the whole source codes of the the project. Many APIs in node are not supported in cordova js files(ex:"require" is only supported in cordova hooks).
The recommended way is to use the Twitter Rest API in your cordova app through Ajax.

Elvis Xia - MSFT
- 10,801
- 1
- 13
- 24
-
Do I need plugins If I use this from github/npm ? – APX100 Nov 28 '16 at 04:37
-
No, you don't need plugins for Rest API. If you are not familiar with the concept of Rest API, I suggest you reading [What is Restful programming](http://stackoverflow.com/questions/671118/what-exactly-is-restful-programming). – Elvis Xia - MSFT Nov 28 '16 at 05:17
-
No,Ajax is a client-side technology, if you are totally new to ajax, you can refer to [Ajax Wiki](https://en.wikipedia.org/wiki/Ajax_%28programming%29). – Elvis Xia - MSFT Nov 29 '16 at 01:32