Hi to all, Good day, as a beginner I’ve been trying to research about building a tracker app to determine specific points in a certain location. I’ve been stuck in the “native.Webview” command. Is there any way i can change that from a native browser to chrome. Secondly, I’ve been trying to set a link to be opened by my app to a local server such as mysql to download a specific file. The problem is that I can see the link but right after i click the link nothing happens. Your ideas are badly needed. Thanks.
You can open a link in the device’s native browser – versus in a WebView – with:
system.openURL("http://www.google.com/")
I am not aware of any way that you can open it in the Chrome browser directly unless you moved to the Enterprise version. Then you could use this:
https://developers.google.com/chrome/mobile/docs/ios-links
In theory, someone could build a plugin that would allow that. Maybe something that Google could work on with Corona. Or someone else who thought it was worthwhile could do.
As for downloading a file, it’s really easy. Here’s some basic code I use:
function dlNetListener( event ) if ( event.isError ) then native.showAlert( "MY APP", "You don't appear to have an internet connection.", { "OK" } ) elseif event.status == 404 then native.showAlert( "MY APP", "The file was not found", { "OK" } ) elseif event.phase == "ended" and event.status == 200 then -- File was downloaded correctly - do what you want with it here. end end network.download("http://mydomain.com/file.xml?nocache=" .. os.time(), "GET", dlNetListener, "file.xml", system.TemporaryDirectory)
Hello sir, thanks for the advice, i will implement your suggestion. I will update you soon of the development. Thank you for the quick reply. Any ideas how to pass data from a code igniter build web app to an adroid application that is being build by corona sdk? thanks.
In regards to your suggestion sir, The function really works. Thank you for this and now we can proceed in developing our system. Hoping to receive some great pointers from you in the near future.
As for downloading a file, it’s really easy. Here’s some basic code I use:
function dlNetListener( event ) if ( event.isError ) then native.showAlert( "MY APP", "You don't appear to have an internet connection.", { "OK" } ) elseif event.status == 404 then native.showAlert( "MY APP", "The file was not found", { "OK" } ) elseif event.phase == "ended" and event.status == 200 then -- File was downloaded correctly - do what you want with it here. end end network.download("http://mydomain.com/file.xml?nocache=" .. os.time(), "GET", dlNetListener, "file.xml", system.TemporaryDirectory)
You can open a link in the device’s native browser – versus in a WebView – with:
system.openURL("http://www.google.com/")
I am not aware of any way that you can open it in the Chrome browser directly unless you moved to the Enterprise version. Then you could use this:
https://developers.google.com/chrome/mobile/docs/ios-links
In theory, someone could build a plugin that would allow that. Maybe something that Google could work on with Corona. Or someone else who thought it was worthwhile could do.
As for downloading a file, it’s really easy. Here’s some basic code I use:
function dlNetListener( event ) if ( event.isError ) then native.showAlert( "MY APP", "You don't appear to have an internet connection.", { "OK" } ) elseif event.status == 404 then native.showAlert( "MY APP", "The file was not found", { "OK" } ) elseif event.phase == "ended" and event.status == 200 then -- File was downloaded correctly - do what you want with it here. end end network.download("http://mydomain.com/file.xml?nocache=" .. os.time(), "GET", dlNetListener, "file.xml", system.TemporaryDirectory)
Hello sir, thanks for the advice, i will implement your suggestion. I will update you soon of the development. Thank you for the quick reply. Any ideas how to pass data from a code igniter build web app to an adroid application that is being build by corona sdk? thanks.
In regards to your suggestion sir, The function really works. Thank you for this and now we can proceed in developing our system. Hoping to receive some great pointers from you in the near future.
As for downloading a file, it’s really easy. Here’s some basic code I use:
function dlNetListener( event ) if ( event.isError ) then native.showAlert( "MY APP", "You don't appear to have an internet connection.", { "OK" } ) elseif event.status == 404 then native.showAlert( "MY APP", "The file was not found", { "OK" } ) elseif event.phase == "ended" and event.status == 200 then -- File was downloaded correctly - do what you want with it here. end end network.download("http://mydomain.com/file.xml?nocache=" .. os.time(), "GET", dlNetListener, "file.xml", system.TemporaryDirectory)