question

Antonello C. avatar image
Antonello C. asked ·

Instruments xamarin forms Android app

Hi

I have instrumented an android app built with xamarin forms and webview to display web content,

I used the nuget package to instrument this app following this doc:

https://www.dynatrace.com/news/blog/monitor-your-xamarin-apps-with-dynatrace-oneagent/

and on dynatrace side I see the actions made by users, named " touch on .." but still not see the web requests .

Inside the code I have this webview function that made http requests, so my questions is about instrument it to send monitoring data to dynatrace.

public InAppBrowserCode(string URL)

{

.............................................

webView = new WebView () { WidthRequest = 1000, HeightRequest = 1000, Source = URL };

controlBar.Children.Add(backButton);

regards

Antonello

androidmobileappfaq
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Answer

Matthias H. avatar image
Matthias H. answered ·

So you are telling the Web Request is created within the Webview? If this is the case only the JSAgent might be suitable for tracking requests in a Webview. But if you use HttpClient, the package provides a method called SetupHttpClient(httpClient) which will add a handler to the client.

Regards,

Matthias

3 comments Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Have you more detail about how to use JSAgent in this scenario? The automatic js injection from the application server (oneagent) doesn't solve.

Regards

Antonello

0 Likes 0 · ·

What is in the webview? When it is a local index.html I would also include the JSAgent locally via script. If it something external I would use the automatic js injection. Basically you should already see that the JSAgent is then reporting to the web application. If not, then something with the JSAgent setup is wrong.

Additionally you can enable DTXHybridApplication for the Native Agents. DTXSetCookiesForDomain will also help you here if the WebView is working in a different domain.

As this is a rather complicated topic I would suggest you to open up a support ticket.

0 Likes 0 · ·

Hi Matthias I would try to add a java script tag for the JSAgent in the local html code, but is not clear how can I get the snippet code from the mobile App I created in Dynatrace.

Is this possible or I must create another web app and gather from this the JSAgent code snippet?

Thanks

0 Likes 0 · ·