EN Android Performance

loading
Android Tools - Log2File

Log2File is a utility class for Android applications to record logs to a file (such as the SD card).

Usage Scenarios:

  1. Unable to connect to a computer for debugging (e.g., USB port is occupied by USB OTG).
  2. Logs are difficult to capture in real-time.
  3. Bugs appear randomly and are not easily reproducible.
  4. Other scenarios where persistent logging is needed.

0. Introduction

This article was originally published on my CSDN blog: http://blog.csdn.net/grackergao/article/details/18322749. I have now migrated it here. The source code is available on Github: https://github.com/Gracker/Android-Utils/blob/master/Log2File.java.

Ubuntu: Adb Command Cannot Find Device

1. Problem Overview

Recently, while developing for a Nokia project, I encountered the following issue:

When I plugged in a Nokia X, the computer did not respond at all—it wasn’t recognized. My colleague’s Windows machine also failed to detect it. After searching Google for a long time, I finally found a solution. Since I didn’t record it originally and later forgot how to configure it when helping someone else, I decided to document it here for everyone.

2. Solution

If the adb command indicates that no devices are found, please ensure you have already completed these basic steps:

  1. Enable USB Debugging (Settings - Developer Options - USB Debugging). If you don’t see Developer Options, go to “About” and tap the Build Number several times.
  2. Restart Adb with Sudo: Try sudo adb kill-server and sudo adb start-server.

If it still doesn’t work, follow the steps below:

Android Service: Building Your Own Notification Center (1) - Introduction to Accessibility Service

1. Introduction to Accessibility Service

Accessibility services are a feature of the Android framework designed to provide alternative navigation feedback to users on behalf of applications installed on Android devices. An accessibility service can communicate information about the application to the user, such as text-to-speech, or haptic feedback when the user’s finger hovers over an important area of the screen.

This section covers how to create an accessibility service, how to handle information received from applications, and how to provide feedback to the user.