Android应用程序使用android

Android应用程序使用android

本文介绍了Android应用程序使用android.permission.READ_LOGS - 是不礼貌的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序可从Android Market。有些用户要求进行调试时,事情没有按预期工作,走出了一条途径。我一直在寻找到添加菜单项,将显示输出

I have an app that is available from the Android Market.Some users have asked for a way of debugging when things don't work out as expected.I have been looking into adding a menu item that will display the output of


    Process mLogcatProc = null;
    BufferedReader reader = null;
    mLogcatProc = Runtime.getRuntime().exec(
        new String[] {"logcat", "-d", "AndroidRuntime:E BDtN:V *:S" });
    reader = new BufferedReader(new InputStreamReader (mLogcatProc.getInputStream()));
    String line;
    ArrayList listOfLogLines = new ArrayList();
    while ((line = reader.readLine()) != null)
    {
        listOfLogLines.add(line);
    }

基本上我提取日志的部分。*行,我的程序已经被写和错误的Andr​​oidRuntime已经抛出。

Basically I am extracting the parts of the Log.* lines that my app has been writing and the errors that the AndroidRuntime has been throwing.

我有一个工作原型,将显示给用户的日志,我已提取在ListView部分的内容。

I have a working prototype that will display to the user the contents of the part of the log that I have extracted in a ListView.

我将不得不android.permission.READ_LOGS添加到AndroidManifest.xml文件,以便我的应用程序已读取访问日志,这当然将是信息的用户将被提示安装之前。而问题是,如果这被认为是不礼貌的,危险的或以其他方式与众不同。它会阻止用户安装?

I will have to add android.permission.READ_LOGS to the AndroidManifest.xml file in order for my app to have read access to the log, and this of course will be information that the user will be prompted with before installing.And the question is if this is considered impolite, dangerous or otherwise out of the ordinary. Will it keep users from installing?

推荐答案

我不会安装一个应用程序,这样做。如果你想要的是你自己的日志,您的应用程序可以保持它写入与系统日志沿着自己的私人日志缓冲区。

I wouldn't install an app that did this. If all you want is your own logs, your app can keep its own private log buffer that it writes into along with the system log.

您可能甚至不需要虽然做到这一点:http://android-developers.blogspot.com/2010/05/google-feedback-for-android.html

You may not even need to do this though: http://android-developers.blogspot.com/2010/05/google-feedback-for-android.html

这篇关于Android应用程序使用android.permission.READ_LOGS - 是不礼貌的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:55