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 7763017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:33:33+00:00 2026-06-01T14:33:33+00:00

I am developing a application which uses location services. I need to debug the

  • 0

I am developing a application which uses location services. I need to debug the application using Log.d() but that needs the device to be connected to the computer all the way. And that’s impossible for me to do. I’ll be testing the app for about two hours in travelling. I cannot connect it to PC at that time.

Is there any way to save the log in phone and retrieve it later and can see the LOG data.

  • 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-01T14:33:34+00:00Added an answer on June 1, 2026 at 2:33 pm

    Introduce your own Logger class, a wrapper for android.util.Log class, which will redirect output both, to file and console:

    public class Logger {
    
        public static PrintWriter printWriter = null;
    
        private static void init() {
            ...
            // Check if external media is writable
            ...
    
            if (printWriter == null) {
                try {
                    File dir = new File(Environment.getExternalStorageDirectory() + LOG_DIR);
                    dir.mkdirs();
                    printWriter = new PrintWriter(new FileWriter(new File(dir, LOG_FILE), true));
                }
                catch (IOException e) {
                    Log.e(Logger.class.getName(), "initExternal() -> IOException", e);
                }
            }
        }
    
        private static synchronized int log(int priority, String tag, String msg) {
            int res = Log.println(priority, tag, msg);
    
            init(); // May be called just once, depending on your requirements
    
            printWriter.print(tag + "   ");
            printWriter.print(msg + "\r\n");
            printWriter.flush();
            return res;
        }
    
    
        // Duplicates of standard android.util.Log methods:
        public static int v(String tag, String msg) {
            return log(Log.VERBOSE, tag, msg);
        }
        public static int v(String tag, String msg, Throwable tr) {
            return log(Log.VERBOSE, tag, msg + '\n' + Log.getStackTraceString(tr));
        }
        public static int d(String tag, String msg) {
            return log(Log.DEBUG, tag, msg);
        }
        public static int d(String tag, String msg, Throwable tr) {
            return log(Log.DEBUG, tag, msg + '\n' + Log.getStackTraceString(tr));
        }
    
        ...
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application for ios which uses sqlite3 I need to debug a
I'm developing a PHP application which uses Twig (but that's unimportant) as the view
I am developing grails application which uses file searching.For that I wrote the following
I am developing an application which uses Bluetooth to connect to a device and
I am developing an IOS application, which uses web services (SOAP/WSDL). I have built
I have heard that when developing application which uses a database you should do
I was developing an application which uses the places API through the Javascript Library
We are developing a WPF application which uses Telerik's suite of controls and everything
I'm developing an Android application which uses the AccountManager to get access to the
I'm developing a CakePHP application which uses the standard CakePHP URL schema. If I

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.