📜 ⬆️ ⬇️

Writing feedback function for Android applications

A recently raised topic about widgets prompted the idea to share my experience in, as it turned out, the difficult task of finding errors.

Once, without finding a decent widget to display the date on the desktop, I wrote my own simple ExtDateWidget.
Of course, I checked it on several emulators and a real device and put it on the Market. But what works on my phone and in the emulator does not necessarily work everywhere. Error messages affect the variety of the reports themselves and the described behavior of an absolutely uncomplicated application in hardly a hundred lines. From the most banal: the widget does not appear on the table or is not updated at midnight; to exotics in the form of dropping a single setting (I assure you, absolutely identical to all others) or the appearance of superimposed copies of the widget during an update (it is impossible to believe in it at all, but is described in great detail).
Of course, the Error Reporting page in the Market is empty, and the entries in it do not always give rise to the essence.

How to solve user problems?
')


Of course, I started trying to blindly change pieces of code that could at least theoretically not work. For example, I found an article in which it is written that it is better to use services to update the widget instead of broadcast messages. A month has gone by quite frequent releases before the idea has proven to be unviable. Such methods are not for us.

On the right path pushed the project to Google Code - send-me-logs .
The idea is simple: collect the log (the one that can be viewed in the Dalvik Debug Monitor) and send it to the developer by mail.
I made few key changes: in order for the tag filter to work, you need to add the -s option to the LogCat call. It would also be nice to limit the number of log lines to be output, otherwise the generation of a mail message may permanently suspend the application. Optimally, in my opinion, to write no more than 50 lines, but in most cases, and so the reports come in much smaller size, so this is a safety net.
How to filter log entries is described in the documentation , but for a small application, I just do all the entries with the ExtDateWidget tag, then the call looks like this:

public ArrayList<String> getLog(String tag) { ArrayList<String> lines = new ArrayList<String>(); /* ,    send-me-logs,    -s */ collectLog(lines, null, null, new String[] {tag}); return lines; } ArrayList<String> logLines = getLog("ExtDateWidget"); 


To complete the picture, we add the current settings to the log:

 mSettings = PreferenceManager.getDefaultSharedPreferences(mContext); ... StringBuilder setsString = new StringBuilder("Settings: \n"); Map<String, ?> sets = mSettings.getAll(); if (sets != null) { for (String key: sets.keySet()) { setsString.append(key).append(": ") .append(String.valueOf(sets.get(key))).append("\n"); } } 


Advantages of the method: if your application is necessary, there will be active users who are ready not only to give a report describing the incorrect behavior, but also to try to correct the error. My widget is moderately popular, but even for him more reports started coming in than I can handle. I can not say that all the error messages have become meaningful at once, but at least the system version and the model of the device are automatically added. In general, it seemed to me that user loyalty increased only because the function of the error report shows that the developer is not all the same.
In addition, the logging system is convenient; you can make several report variants, for example, only the Warning level and higher or all, including system errors. Plus, you do not need permission to work with the Internet, users should not worry that their data is slowly floating away in an unknown direction.
I also very much hope that the presence of such a function in a prominent place will push the user not to write the comment “not work”, but directly report the essence of the problem.

Disadvantages: there are paranoids who, even in the absence of the requirement of accessing the network and having a description of the error reporting system, are worried about why this application has their “confidential information” and reduces the ratings.
Even worse, if you have ads that need internet.

An alternative method is to use a separate application for generating reports. This is already on the Market. The site shows an example of use: http://l6n.org/android/sendlog.shtml .
The advantages are obvious: your application doesn’t need additional permissions at all, and if someone wants to help, they will most likely install a small utility (it only needs to read the logs) to send you a report and get an exclusive fix. Although additional operations for users are still a drawback of the method.

Well, for the most industrious it is possible to write your application-report generator, although this, in my opinion, does not give any visible advantages.

I hope the methods described will help improve the ratings of your applications.

Source: https://habr.com/ru/post/114776/


All Articles