Android Question Send Data to External Browser Using POST

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hello All,

is there any way to POST data to an external browser called using intent? (sometimes it's not interesting to show the data sent by app to browser and, when you're in a public wifi, could also be dangerous to use GET)
 

DawningTruth

Active Member
Licensed User
Hello All,

is there any way to POST data to an external browser called using intent? (sometimes it's not interesting to show the data sent by app to browser and, when you're in a public wifi, could also be dangerous to use GET)
Maybe I'm missing the question, but couldn't you just start a new browser and use parameters in the URL. Would that not be much simpler?
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Maybe I'm missing the question, but couldn't you just start a new browser and use parameters in the URL. Would that not be much simpler?
Hello @DawningTruth ,

there are at least two problems passing parameters in the URL:

1. When you do that, you're using GET and your data is being sent to the internet without cryptography (if you are sending an username and password, could be a BIG security problem)
2. The user will be able to see the link and reproduce without using the app (which is a problem also). Imagine a resource that must to be accessed ONLY using your app being called directly from browser...

That's it...
 
Upvote 0

DawningTruth

Active Member
Licensed User
Ok Marcos, I'm going to brainstorm here, because it is clear that this is a challenge which requires some form of workaround.

Here is a workaround which requires server programing as well:

1. Pass secure encrypted data via the normal B4X API methods. Make sure your app and the server have a common key.
2. The server reads the data and produces a one-time token relevant to that data.
3. Your app reads the token. eg: ghreu69sfh
4. You access your website with just the one time token as a parameter: http://www.yourwebsite.com/?tk=ghreu69sfh This is done via the external webbrowser intent.
5. Your server reads the token and returns the appropriate page or info.
6. Your server blocks the token.

Perhaps this approach may be of assistance.
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hello,

that's exactly what I'm thinking to do...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…