equivalent to dll in android/phonegap

93 views
Skip to first unread message

Doc Jump

unread,
Mar 9, 2017, 4:01:22 PM3/9/17
to phonegap
Hello. Is there anything like a windows dll in android/phonegap? That is, an application that is separately compiled and available to the main javascript/html/android/phonegap application. From the online documentation it appears that a plugin in not the answer. Any help will be appreciated.

Kerri Shotts

unread,
Mar 10, 2017, 9:00:47 AM3/10/17
to phonegap
Can you clarify your use case here?

johnwargo

unread,
Mar 10, 2017, 11:54:18 AM3/10/17
to phonegap
No. Cordova/PhoneGap don't have that type of capability. That's an OS-level capability that a Cordova or PhoneGap app can leverage if the OS supports it. But...that's a native application capability, so you'd need native code in your Cordova app to make the call to the native DLL or whatever you 

In Cordova, it's plugins. Plugins include a JavaScript interface and either JavaScript or native code that delivers functionality. Plugins like Camera, and many others, provide native capabilities and expose them through the JavaScript interface. That's the only thing Cordova supports out of the box. Otherwise, you'll have to modify the native Cordova container to call your Windows DLL (Android and iOS don't support DLLs)

Doc Jump

unread,
Mar 15, 2017, 4:35:34 PM3/15/17
to phonegap
Kerri - the situation is this; I have some functionality written in javascript/html/phonegap. I want to make that functionality available to customers who create their own custom code that would need my functionality. Obviously , I don't want them to have access to my source code. This is similar in nature as a dll in windows.
Regarding johnwargo's comments, perhaps my evaluation of plugins based on online information is flawed. I got the impression that a plugin makes basic or I guess native functionality. So the plugin is written in native code? For example, a barccode scanner plugin or gps plugin. My functionality does not employ native code

johnwargo

unread,
Mar 15, 2017, 5:52:55 PM3/15/17
to phonegap
Plugins are at a minimum JavaScript code. There's an example of a JavaScript-only plugin in my latest Cordova book's code at https://github.com/johnwargo/ac4p/tree/master/chapter%2016/mol. You can also add native code to a plugin, accessing it from your plugin's JavaScript code using the JavaScript to Native bridge Cordova includes. Most Cordova plugins have some Native code, but not all. You can find an example of a native plugin in the same repo. 

You can't 'hide' your plugin's JavaScript code, but you can include pre-compiled binaries of your plugin's native code if you want. 

Doc Jump

unread,
Mar 15, 2017, 6:59:28 PM3/15/17
to phonegap
Thanks for that johnwargo. So what you are saying is that if I have a javascript ONLY plugin, I can't hide the source, i.e., a pre-compiled version of the plugin?


On Thursday, March 9, 2017 at 1:01:22 PM UTC-8, Doc Jump wrote:

jo...@johnwargo.com

unread,
Mar 15, 2017, 7:06:49 PM3/15/17
to phon...@googlegroups.com
Correct.  You can obfuscate it, but not hide it (as far as I know)

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/xWunUYhAxrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Willett

unread,
Mar 16, 2017, 3:36:49 AM3/16/17
to phon...@googlegroups.com
If your source code is that important to you, then if its in JavaScript its difficult. 

There are Android libraries for encrypting stuff and I thought there was a discussion on this very issue in this group but I can't seem to find it.

Rob

On Wed, Mar 15, 2017 at 11:06 PM, <jo...@johnwargo.com> wrote:
Correct.  You can obfuscate it, but not hide it (as far as I know)
On Mar 15, 2017 6:59 PM, Doc Jump <doc7...@gmail.com> wrote:
Thanks for that johnwargo. So what you are saying is that if I have a javascript ONLY plugin, I can't hide the source, i.e., a pre-compiled version of the plugin?

On Thursday, March 9, 2017 at 1:01:22 PM UTC-8, Doc Jump wrote:
Hello. Is there anything like a windows dll in android/phonegap? That is, an application that is separately compiled and available to the main javascript/html/android/phonegap application. From the online documentation it appears that a plugin in not the answer. Any help will be appreciated.

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to a topic in the Google Groups "phonegap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phonegap/xWunUYhAxrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phonegap+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages