0

after I run any application on my phone, using free version of AIDE -IDE Android, everytime I view LogCat, I get the same message : " run the app to see the log output ".! Here is the following screenshot :(https://i.stack.imgur.com/uLORU.png) Is LogCat free on AIDE-IDE Google play app ? Thank you for your attention.

3 Answers3

1

It's free as far as i know, but you need root access in order for log to work. Besides: it doesn't work from time to time with root either.

Another option: use following function to log to local file:

public void appendLog(String text)
// https://stackoverflow.com/a/6209739
{       
File logFile = new File("sdcard/log.file");
if (!logFile.exists())
{
    try
    {
        logFile.createNewFile();
    } 
    catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
try
{
    //BufferedWriter for performance, true to set append to file flag
    BufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true)); 
    buf.append(text);
    buf.newLine();
    buf.flush();
    buf.close();
}
catch (IOException e)
{
    // TODO Auto-generated catch block
    e.printStackTrace();
}
}

Use it like this:

try{
   // your code goes here
}catch (Exception e){
   appendLog(e.getMessage());
}

You need to add permission for writing_external_storage in Manifest.

  • Hello, II tried your appendLog function, which gives the following error : " method appendLog(java.lang.String) cannot be applied to java.lang.Exception", as shown below.Thank you for your attention, and excuse me for my long delay to answer you. – Denys Plaud Jul 29 '18 at 17:13
  • Sorry, had a typo in here. Edited my answer accordingly, thanks for the hint. – BenjaminWegener Jul 29 '18 at 17:58
0

There is no problem with your code. However the problem is with AIDE version your using. Am using the Pro and Logcat is working fine for me

DiLDoST
  • 335
  • 3
  • 12
-1

I found this way, as shown below, using Log.getStackTraceString(Exception e), to solve my LogCat View trouble on AIDE-IDE Android. The only remaining question is why there is no display of Log.e (TAG,"Exception ",e) ? Thank you for your attention. Code of MainActivity (https://i.stack.imgur.com/Dqfc5.png)