Cordova Plugin Requires Internet Connetions??

Cordova Plugin Requires Internet Connetions??

  

Hi Team,


I want to use cordova plugin to my application, but it requires internet ??

When I used using github-url or resource options having zip file, It is working fine when there is network available but when device goes offiline its not working.


Please suggest how to use third party cordova plugin in offline way in outsystems application

Please help me out its urgent.


Thanks/Regards

Dileep 

Hi Dileep,

What do you mean by "not working"?

If the plugin requires something from internet, if it make connections (like, something that access a cloud service), than it will not work if the device is offline.

Usually, developers put safeguards in the code, so that if a feature (no matter based on what, plugin or not) requires network, or it disable the feature when offline, or it works using local storage and client actions only (if possible, what seems to not be the case)

Cheers.
Eduardo Jauch  

EDIT
What is the plugin that you are trying to use, and are you sure the problem is the plugin?

Hi Dilèep,

Afaik the mobile application will download almost all resources it needs when the application starts including the cordova plugins which contains javascript interface and java native. So, in this case it needs to be online. I still do not know what happens then when it is offline - given that the plugins does not need to access other resources online - whether it is volatile or nonvolatile once the application is going offline or restarted again. I'll explore later.

regards,

Indra

Eduardo Jauch wrote:

Hi Eduardo,

Hi I am using some EMDK Cordova plugin  to use in Zebra Device: 

https://github.com/DavidTalamona/Cordova-Plugin-BarcodeScanner-EMDK.git


As suggested https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/Mobile_Plugins/Create_a_Plugin_to_Use_Mobile_Capabilities_in_Your_Application

I am using this plugin either Url or Resources, When I put this on resource folder and try to access it it is working fine when network is available, and not working when I put device on offline.

Is there any way to use this plugin on offline , please do let me know


thanks

Dileep

Hi Dileep,

What do you mean by "not working"?

If the plugin requires something from internet, if it make connections (like, something that access a cloud service), than it will not work if the device is offline.

Usually, developers put safeguards in the code, so that if a feature (no matter based on what, plugin or not) requires network, or it disable the feature when offline, or it works using local storage and client actions only (if possible, what seems to not be the case)

Cheers.
Eduardo Jauch  

EDIT
What is the plugin that you are trying to use, and are you sure the problem is the plugin?



Indra Budiantho wrote:

Hi Indra,

 I am using some EMDK Cordova plugin  to use in Zebra Device: 

https://github.com/DavidTalamona/Cordova-Plugin-BarcodeScanner-EMDK.git


As suggested https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/Mobile_Plugins/Create_a_Plugin_to_Use_Mobile_Capabilities_in_Your_Application

I am using this plugin either Url or Resources, When I put this on resource folder and try to access it it is working fine when network is available, and not working when I put device on offline.

Is there any way to use this plugin on offline , please do let me know


thanks

Dileep

Hi Dilèep,

Afaik the mobile application will download almost all resources it needs when the application starts including the cordova plugins which contains javascript interface and java native. So, in this case it needs to be online. I still do not know what happens then when it is offline - given that the plugins does not need to access other resources online - whether it is volatile or nonvolatile once the application is going offline or restarted again. I'll explore later.

regards,

Indra



Hi Dileep,

I would say that the problem is not the Cordova Plugin. Once your application is installed in the device, all the resources are there, no need to download anything during runtime.

Possibly is your code that is not prepared to run OFFLINE, and is trying to do something that requires it to be online, like fetch data from a server aggregate, create or update records in server database, etc.

Please, revise your code, as work offline is much simpler now, in Hybrid mobile apps, but it still requires that you program the application thinking in this situation. You have to control what to do if the app goes offline.

Cheers.
Eduardo Jauch 

HI, DIlleeep,

The plugin should work when Offline, after the application download it first time. I can see my ToDo application still work with this github when offline:

regards,

indra

Indra Budiantho wrote:

Hi Indra, thanks But I am using resource options I am having zip file of Cordova plugin and put it under my resource folder of plugin App.

Now resources having js jar and java files. It is working when I launch application on online mode and Not working on offline.


Its also working when once application is online first launch and become offline . problem is when I launched application on offline becomes problems.


Thanks

Dileep


HI, DIlleeep,

The plugin should work when Offline, after the application download it first time. I can see my ToDo application still work with this github when offline:

regards,

indra



Eduardo Jauch wrote:


Hi Eduardo, thanks But I am using resource options I am having zip file of Cordova plugin and put it under my resource folder of plugin App.

Now resources having js jar and java files. It is working when I launch application on online mode and Not working on offline.


Its also working when once application is online first launch and become offline . problem is when I launched application on offline becomes problems.


Thanks

Dileep

Hi Dileep,

I would say that the problem is not the Cordova Plugin. Once your application is installed in the device, all the resources are there, no need to download anything during runtime.

Possibly is your code that is not prepared to run OFFLINE, and is trying to do something that requires it to be online, like fetch data from a server aggregate, create or update records in server database, etc.

Please, revise your code, as work offline is much simpler now, in Hybrid mobile apps, but it still requires that you program the application thinking in this situation. You have to control what to do if the app goes offline.

Cheers.
Eduardo Jauch