How can I get post back response using webview in android? - android

Currently I am working on payment integration for native android app after send the request it have given me post back url with some attributes as success/fail response. I can't understand that how can I get those post back url attributes values using WebView . If any one know,
Please suggest me some idea for that.

Related

Receive POST information from callback, Android WebView

My scenario is this: we point the user to a form where they fill in the data (3DSecure) and then POST, the website then POSTS the response to a callback URL - this response is what I want to capture. WebView.shouldInterceptRequest() can get the headers but not the content (Why, Google?). I tried this link and it can get the POST data that the user sends. Is there any way to use Javascript to catch the POST data being received to a callback of my choosing?
I saw this post from 5 years ago and the man resorted to POSTing the response back to a server and then getting the contents from the phone. This is far from ideal. Surely there's a newer solution?
shouldInterceptRequest() mentions that a response contains the "response information or null if the WebView should load the resource itself", how do I get it so that the WebView shouldn't load the resource itself? The source code seems to return null always.
I used this gentleman's library: https://github.com/LivotovLabs/3DSView
If one was looking to do this with something other than 3DSecure they could use it as a template.

Getting callback from payment gateway in webview

I am using Atom Payment Gateway for payments in my Android app. But this provider doesn't have an SDK for mobile platforms, also I cannot choose another provider because my client has been using Atom PG for their website for a long time.
So to make it work, I am now trying to call it in a webview in my app. All goes well until the last step except that I am not able to get the response from the PG upon completion of transaction.
As per their documentation:
After the completion of the transaction, the response will be posted back to the url provided by the merchant.
I already tried setting the return url to my reverse domain name and then setting an intent-filter but that doesn't seem to work.
Is there any method by which I can get the response that the PG "posts back" to the return url?
Here is an idea,
On getting the post request on your return url, you can parse that response and then via javascript send that to the JavascriptInterface linked to your WebView in the app
Intercepting POST data has been discussed:
How to intercept POST data in an android webview
Intercept POST requests in a WebView
Try this project : https://github.com/KeejOow/android-post-webview

How to Receive and Post data to Website from Android app

I want to Receive Response and Post data from Android app to fill a Registration Form.
I want to access a website which returns session_id from the first page.
Means when App get start, I will access the Home page and get the session_id, using that session_id and some fields in my App, I want to post the data to server of website.
What should be used to do the above Task ?
I have used Jsoup and Parse HTML to get session_id ( not in Main Thread ), Succeed ,
But How to post data ? I used Another activity to load the next page of website but it shows session expired. I also find other options like using HttpURLConnection , But I don't get an appropriate Example. I am new bee to android . Please help if know.
use Android Volley , http://developer.android.com/training/volley/index.html
this is all about network solution in Android.

Android HTTP Post upload image in webview session

I've been reading for more than three days about this and my head is totally messed up. I saw too much code.. Plaase help!
I have an application with a webview. In this webview I am logged in an account. So this means that when I get to the upload part I must use the webview session. I didn't understand very clear how to work with cookies. Also in the uploader I must set the Content-type and the Content-Disposition.
So my question is: Would you give me an example all this things? Getting the cookies, setting them to the http post request and setting the cookies so I can send the image. Thanks!

Android: Fail to retrieving a tag value of the EWS response

I am hitting my Exchange server using (EWS+Basic Authentication). I could authenticate and hit my services with these Request GetItem (E-mail Message),SyncFolderItems and few other and getting the response successfully. I could parse the SyncFolderItems response to get basic info abt the Mail Items (Like Subject,To,From,HasAttachments etc.). But when i hit the GetItem request i am receiving a response but i couldnt get the Mail item Body (i.e, the Message). Is it any tutorial to do this. I am using XMLPullParser..
The response might be look like this . Plz guide me on this
I've used JWebServices for Exchange (Android version) several times. It's not free but accomplished what I needed. You should try the API to see if they get correct Body to see if your application fails or body is empty.
Thanks for ur valuable replies.. I found the data (values) that i stored from the saxparser is not complete. So only i couldnt get the html content properly in the webview.
i used the following link as reference and used the string buffer to resolve this issue.
Thx

Categories

Resources