Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:58:33+00:00 2026-06-17T13:58:33+00:00

I want to save my app logcat events in a text file on sd

  • 0

I want to save my app logcat events in a text file on sd card.
my alarming app work properly in my and my friends devices, but other have error on my app.
for example they say alarms in app are in wrong time, but i dont see this error in my and my friends devices.
Because of this issue and other issues, i want save all events logcat related my app, atomatically. so they send log file to me to solve issues.
how can i do this?
thanks
sorry for my bad english

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:58:35+00:00Added an answer on June 17, 2026 at 1:58 pm

    You can get logcat via the following:

    static final int BUFFER_SIZE = 1024;
    
    public String getLogCat() {
        String[] logcatArgs = new String[] {"logcat", "-v", "time"};
    
        Process logcatProc = null;
        try {
            logcatProc = Runtime.getRuntime().exec(logcatArgs);
        }
        catch (IOException e) {
            return null;
        }
    
        BufferedReader reader = null;
        String response = null;
        try {
            String separator = System.getProperty("line.separator");
            StringBuilder sb = new StringBuilder();
            reader = new BufferedReader(new InputStreamReader(logcatProc.getInputStream()), BUFFER_SIZE);
            String line;
            while ((line = reader.readLine()) != null) {
                sb.append(line);
                sb.append(separator);
            }
            response = sb.toString();
        }
        catch (IOException e) {
        }
        finally {
            if (reader != null) {
                try {
                    reader.close();
                }
                catch (IOException e) {}
            }
        }
    
        return response;
    }
    

    You can then save this String to the sdcard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to save a .txt file in my iPhone app, but I want
In my app, I open the camera and want to save that file with
i am facing one problem. i want to save settings in app.config file i
I am making an app were I want to save the text of a
In my linux python app for Fedora I want to save user's work to
I want to save a text file on the wp7 file system that doesn't
in my app I want to save the text that was typed in in
I want to save some values before i closed the app. But i don't
I'm looking for a place to save my app's license file. I want it
I want to save some plain text periodically to a text file, and it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.