Network Access for Standalone Applications
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 5
- Joined: Wed Feb 03, 2021 4:43 am
Network Access for Standalone Applications
I am working on an application for Android on my MACBook Pro. (Community Version LC9) and BigSur.
The application works fine on the Mac. However when I compile for standalone use the application has no access to the network.
I am using a restAPI webserver on my network. The virtual Android, Real Tablet and my mac via chrome can all access the RESTapi no problem.
All standalone applications have no access to the network. Virtual, Tablet or MAC. I have tried every setting in standalone applications and I can see that android tablets have no access by default and there does not seem to be a way to turn this on.
Is this a community version issue? or some setting I am missing. I create a very basic application from this guide:
"How to Request a Resource from a REST API" from Livecode lessons.
It works in Livecode but not as a stand alone application.
The application works fine on the Mac. However when I compile for standalone use the application has no access to the network.
I am using a restAPI webserver on my network. The virtual Android, Real Tablet and my mac via chrome can all access the RESTapi no problem.
All standalone applications have no access to the network. Virtual, Tablet or MAC. I have tried every setting in standalone applications and I can see that android tablets have no access by default and there does not seem to be a way to turn this on.
Is this a community version issue? or some setting I am missing. I create a very basic application from this guide:
"How to Request a Resource from a REST API" from Livecode lessons.
It works in Livecode but not as a stand alone application.
Re: Network Access for Standalone Applications
Hi cbitterfield,
Might be worth manually setting inclusions in the standalone settings and ensuring internet, SSL, JSON and mergJSON
are included (along with any other functionality needed by your app).
When things work in the IDE but not the standalone, it’s usually because of missing inclusions (the automatically detect inclusions setting doesn’t work that well!).
Hope that helps,
Stam
Might be worth manually setting inclusions in the standalone settings and ensuring internet, SSL, JSON and mergJSON
are included (along with any other functionality needed by your app).
When things work in the IDE but not the standalone, it’s usually because of missing inclusions (the automatically detect inclusions setting doesn’t work that well!).
Hope that helps,
Stam
Re: Network Access for Standalone Applications
This same question came up recently elsewhere, Jacque may have already provided the answer you need.
-
- Posts: 5
- Joined: Wed Feb 03, 2021 4:43 am
Re: Network Access for Standalone Applications
Followed the instructions and still not working:
Inclusions
RESTapi works via Chrome on virtual Tablet
No Response on get JSON from URL on Application. (Just hangs)
No data transferred
On the Application Permissions; no permissions granted is showing.
I can't enable permisions (all) it doesn't stick.
Application is signed for development.
During installation it does say no special permissions required.
Also OSX (APP) does work now.
The RESTapi is running http unencrypted and does not require any keys or security. (simple get provides response)
Inclusions
- Switch Button
Spinner
Browser
JSON Library
Time zone Library
DataGrid
Internet
SSL & Encryption
Answer Dialog
Ask Dialong
mergJSON
- Requirements and Restrictions
- Telephony CDMA
- Telephony GSM
Application Permissions
Write External Storage
Internet
Vibration
Idel Timer
RESTapi works via Chrome on virtual Tablet
No Response on get JSON from URL on Application. (Just hangs)
No data transferred
On the Application Permissions; no permissions granted is showing.
I can't enable permisions (all) it doesn't stick.
Application is signed for development.
During installation it does say no special permissions required.
Also OSX (APP) does work now.
The RESTapi is running http unencrypted and does not require any keys or security. (simple get provides response)
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Network Access for Standalone Applications
Virtual emulators do not always respond like real devices. Do you have access to a real Android device?
You could also try adding the TSNet inclusion, it adds more advanced features to the internet library (you should include both.)
You could also try adding the TSNet inclusion, it adds more advanced features to the internet library (you should include both.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 5
- Joined: Wed Feb 03, 2021 4:43 am
Re: Network Access for Standalone Applications
I checked in with an Android 9 tablet. (Same issue)
TSNet is only in LiveCode Indy or Business.
TSNet is only in LiveCode Indy or Business.
-
- Posts: 5
- Joined: Wed Feb 03, 2021 4:43 am
Re: Network Access for Standalone Applications
Is there anyway to get this to work on Community Edition or Community Plus Edition?
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Network Access for Standalone Applications
I'm sure you can make it work but there's not enough info to tell what's wrong. Do you get the result after executing an internet interaction? You can "answer the result" or write it to a log. That may tell you something. Also extensive logging can allow you to see where in the scripts things go wrong. On mobile I usually write the log to a file in the documents folder and then add a temporary button that puts the log text into a field so I can read it.
Or you could post the relevant part of the script here, maybe someone will notice a problem.
Or you could post the relevant part of the script here, maybe someone will notice a problem.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Network Access for Standalone Applications
Hi
This might be because of the version of Android your devices are using and the fact that the RESTapi is running http unencrypted. Starting with Android 9 cleartext support is disabled by default which prevents http connections.
There is a bug report for this which includes some options for workarounds.
https://quality.livecode.com/show_bug.cgi?id=22400
I hope that helps.
Elanor
This might be because of the version of Android your devices are using and the fact that the RESTapi is running http unencrypted. Starting with Android 9 cleartext support is disabled by default which prevents http connections.
There is a bug report for this which includes some options for workarounds.
https://quality.livecode.com/show_bug.cgi?id=22400
I hope that helps.
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
-
- Posts: 5
- Joined: Wed Feb 03, 2021 4:43 am
Re: Network Access for Standalone Applications
How do I add this file to the Livecode build? Is this an external file? or is there some way to set it?
v/r
v/r
Re: Network Access for Standalone Applications
Hi
If you want to try option 2, which is probably the simpler option, you would need to apply the suggested changes to the Android manifest template in the LiveCode app.
You said you are on Mac so to find this file choose "Show Package Contents" on the LiveCode app bundle. The file you need to modify is in Contents/Tools/Runtime/Android/Manifest.xml. I suggest making a copy of the original file before trying the workaround so you can go back to the original file if you need to.
I hope that helps.
Kind regards
Elanor
If you want to try option 2, which is probably the simpler option, you would need to apply the suggested changes to the Android manifest template in the LiveCode app.
You said you are on Mac so to find this file choose "Show Package Contents" on the LiveCode app bundle. The file you need to modify is in Contents/Tools/Runtime/Android/Manifest.xml. I suggest making a copy of the original file before trying the workaround so you can go back to the original file if you need to.
I hope that helps.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
-
- Posts: 92
- Joined: Thu Feb 14, 2013 7:17 pm
Re: Network Access for Standalone Applications
Elanor,
I need to modify the manifest.xml file to include http support for an arduino web server which can't do https, at least until Panos's fix gets released in the next Livecode version. I am completely stumped how to do this on a mac? When I build the apk, Android studio only allows viewing the package contents, not modifying. I tried including the appropriate xml entry into the included files so it would be included but that doesn't work. Sorry I'm not the most technical so perhaps this isn't possible yet?
Any advice appreciated.
Cheers, Adam
I need to modify the manifest.xml file to include http support for an arduino web server which can't do https, at least until Panos's fix gets released in the next Livecode version. I am completely stumped how to do this on a mac? When I build the apk, Android studio only allows viewing the package contents, not modifying. I tried including the appropriate xml entry into the included files so it would be included but that doesn't work. Sorry I'm not the most technical so perhaps this isn't possible yet?
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>
Cheers, Adam
Re: Network Access for Standalone Applications
Hi Adam
You actually make the changes in the LiveCode app bundle, so the updated version of the manifest file is included in the Android apps you build.
Go to Applications, find your LiveCode app and then follow the instructions to choose "Show Package Contents" etc. The change will then be applied to all Android standalones you make, hopefully that will not be a problem.
Please let me know if you need any further clarification.
Kind regards
Elanor
You actually make the changes in the LiveCode app bundle, so the updated version of the manifest file is included in the Android apps you build.
Go to Applications, find your LiveCode app and then follow the instructions to choose "Show Package Contents" etc. The change will then be applied to all Android standalones you make, hopefully that will not be a problem.
Please let me know if you need any further clarification.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
-
- Posts: 92
- Joined: Thu Feb 14, 2013 7:17 pm
Re: Network Access for Standalone Applications
Thanks, I think I am cluing in now.
What you are saying is go here on my Mac: /Applications/LiveCode Indy 9.6.1.app/Contents/Tools/Runtime/Android/manifest.xml
edit the manifest file and it will include the cleartraffic entry on every android build...
It worked, thanks!
What you are saying is go here on my Mac: /Applications/LiveCode Indy 9.6.1.app/Contents/Tools/Runtime/Android/manifest.xml
edit the manifest file and it will include the cleartraffic entry on every android build...
It worked, thanks!
Re: Network Access for Standalone Applications
Great! Glad to hear you got it working.
The fix is targeted to be included in 9.6.3 so you won't have to worry about it after that. If you do update, when 9.6.2 is released, or if you have to reinstall or are you using a different machine you will need to reapply the manual fix.
Kind regards
Elanor
The fix is targeted to be included in 9.6.3 so you won't have to worry about it after that. If you do update, when 9.6.2 is released, or if you have to reinstall or are you using a different machine you will need to reapply the manual fix.
Kind regards
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode