Skip to main content

3 posts tagged with "API"

View All Tags

Monitoring HTTP Requests in Android Apps

Published: · Last updated: · 4 min read
Don Peter
Cofounder and CTO, Appxiom

Have you ever thought about the importance of a medium in the communication process? A medium, as we know, is a channel through which information is circulated between the sender and the receiver. What if the medium encounters a problem? It then becomes a barrier to an effective communication process.

Similarly, an HTTP API call acts as a medium of communication between the mobile app and the server. Failures in HTTP calls are critical as it affects the functioning of the app, which may lead to users uninstalling the app.

What could be the reasons for HTTP request failure?

Consider a scenario where your app user types all the required credentials in the login screen of your Android app and taps on the login button but nothing happens. As the page becomes unresponsive, chances are your users may uninstall your app never to return. We consider HTTP call issues as fatal issues right up there along with app crashes.

How to overcome this situation?

HTTP request failures can occur when the app sends incorrect data to the server, delayed calls, exceptions thrown during an HTTP call or even executing duplicate HTTP calls. The thing to note here is that developers need to be notified of such issues in real time.

Now the question in your mind will be, should I use a bug reporting tool to manually call functions to report HTTP request issues on every callback block? Well that is messy and time consuming.

Instead, an automated HTTP request tracking mechanism will serve the purpose.

By enabling the HTTP tracking mechanism in Appxiom SDK with a single line of code, developers will be able to monitor for failures in all okhttp based API calls originating from the application.

//Current OkHttpClient code.
client = new OkHttpClient.Builder().build();

Change to,

import com.appxiom.android.appxiomcore.OkHttp3Client;

...

//Appxiom based OkHttpClient code.
client = new OkHttp3Client(new OkHttpClient.Builder()).build();

Please find our detailed Java and Kotlin documentation on enabling HTTP tracking with libraries like OkHttp, Retrofit and Volley.

Are the developers getting notified of HTTP issues enough?

The answer is a big No.

The next logical step is to be able to reproduce and fix them fast. In order to accomplish this, we need to have access to precise data points involved in the execution of an API call.

Appxiom SDK is capable of generating detailed bug reports with data points like complete URL, URL parameters, status code, request body and request-response headers.

But what about user sensitive data?

Making sure that privacy and security is maintained is of utmost importance especially when dealing with HTTP request monitoring. Most of the HTTP calls will have authorization tokens and other sensitive data in the header fields. The tool that is used to track HTTP requests should have a way to mask the sensitive data from the application side itself, which will prevent this data from reaching third party servers.

Appxiom provides a simple and easy to use @AX annotation to enable filtering such sensitive data and prevent it from being sent to the Appxiom dashboard. Please find our detailed Java and Kotlin documentation.

@AX(maskHeaders = {"X-Key", "Accept"})
public class BlogApp extends Application {
@Override
public void onCreate() {
super.onCreate();
Ax.init(this, appKey, platformKey);
}
}

Apart from these, data points like device and device state data along with activity trail will also be included with every issue report.

Appxiom is capable of detecting HTTP request issues in iOS and watchOS apps. Apart from this, SDK is capable of detecting and reporting crashes, frame rate issues, ANR, function failures, feature failures, memory leaks, abnormal memory usage, exceptions and custom issues. Appxiom is available for Android as Java & Kotlin SDK, iOS as Objective-C & Swift Framework and watchOS as Objective-C & Swift Framework.

Visit appxiom.com to learn more about Appxiom. Detailed documentation is available at docs.appxiom.com.

How to Detect HTTP(S) Call Issues in Mobile Apps?

Published: · Last updated: · 2 min read
Don Peter
Cofounder and CTO, Appxiom

Most of the mobile and wearable apps will have a cloud back end with which they communicate using APIs. Any failure in this communication may result in unexpected outcomes and broken features. It is very difficult for developers to be aware about any such problem once the app has gone live.

Appxiom provides a simple-to-implement feature to detect HTTP(S) issues. Adding a single line of code will enable Appxiom to monitor all API calls originating from the app. For implementation details visit documentation for iOS (Swift and Objective-C) and Android (Java and Kotlin).

Appxiom monitors HTTP(S) calls for duplication of calls, error status codes and delay in receiving response (based on bandwidth strength). The bug report will contain request details including request header, query parameters, request body, response header and response body size.Is it important to detect API call issues in app side? Here is our blog on why it is - Detecting API issues in mobile app.

Below is the bug report of an API call issue. The response status code indicates that the URL is wrong and the possible reason is that the user id mentioned in the URL does not exist. This is a bug that need to be fixed in the client side. It's a common mistake that the app sends wrong information in URL, header, query parameters or body and such issues need to be fixed at app side. Also it's very difficult to track some API issues like duplicate API call and delay related issues in server side.

Bug report of an API call issue.This detailed report will enable the development team to reproduce and fix these issues faster.

Appxiom provide a mechanism to mask sensitive header parameters, like authentication token. The SDK will not even send the value of that parameter, instead a ★ is sent. This will help developer to confirm that there is a value for that parameter, but it is masked. Refer documentation for iOS (Swift and Objective-C) and Android (Java and Kotlin).Visit appxiom.com to know more about Appxiom. Detailed documentation is available at docs.appxiom.com.

Detecting API Issues in Mobile Apps.

Published: · Last updated: · 3 min read
Don Peter
Cofounder and CTO, Appxiom

Most mobile apps have a server-side application that it talks to over HTTP / HTTPS. These API calls are usually critical for the successful execution of the features in the app. Any failure during API calls results in incorrect execution and bad user experience. It’s critical for mobile app developers to get notified about such issues so that they can fix them at the earliest and thus prevent bad user behavior.

API calls from mobile apps fail because of the following reasons

  • Server-side Application layer issues

  • Web Server issues

  • Wrong request parameters

  • Wrong request headers

  • Network issues

  • Network and execution delays.

Monitoring at the server side can detect only if the request reaches the application layer. For web server issues, network layer issues and delays, monitoring at server side will not help. The mechanism that helps in detecting all issues related to API call will be to monitor at the request source.

While monitoring API calls from the mobile app side, it’s important not to induce any delay or performance impact in the execution process. Which means, the monitoring tool should not act as a proxy, rather should just be a listener to request and response. It was with this in mind that we built API call failure reporting feature in Appxiom. The tool successfully identifies network issues, error status codes and API call delays and reports the same to the developer.

API call monitoring method comparisonA few days ago, one of our customers faced an issue where a critical feature was not working for some customers. They checked the server side logs, wrote code to monitor API calls and did everything possible, but could not detect any anomaly or error. It was around that time they heard about Appxiom and decided to try it out.

They integrated Appxiom into their app quickly and released a new version with that. Within hours they noticed that one of the API calls was not getting through and was failing to reach the server. As more occurrences of the issue started getting reported by Appxiom, the tool showed them an important data point that all the failures happened from one country.

That’s it. They were using a third party API for one of their features and that particular API was failing in one particular country. Now they could go behind the issue with clear direction. They further dug in and found out that the third party API was in fact blocked in that country. It took some time for them to get the issue fixed as it was outside their control, but they were able to find what the issue was rather than being blank about it.

Appxiom is a mobile SDK which when integrated to mobile apps, identifies memory issues, API failures and delays, failures, and delays in function calls and failures and delays between function calls