Monthly Archives: June 2017

How to use Android Battery Historian

1. Install Docker: https://docs.docker.com/docker-for-mac/install/#install-and-run-docker-for-mac 2. Run Docker docker run -p 5001:9999 gcr.io/android-battery-historian/stable:3.0 –port 9999 3. Fetch battery report To obtain a bug report from your development device running Android 7.0 and higher: $ adb bugreport bugreport.zip For devices 6.0 and … Continue reading

Posted in Android, Mac, Mobile | 1 Comment

Android perssions group

https://developer.android.com/guide/topics/permissions/requesting.html All dangerous Android system permissions belong to permission groups. If the device is running Android 6.0 (API level 23) and the app’s targetSdkVersion is 23 or higher, the following system behavior applies when your app requests a dangerous permission: … Continue reading

Posted in Android, Mobile | Leave a comment

Java Effective

Chapter 2. Creating and Destroying Objects Item 1: Consider static factory methods instead of constructors Item 2: Consider a builder when faced with many constructor parameters Item 3: Enforce the singleton property with a private constructor or an enum type … Continue reading

Posted in Android, Mobile | Tagged | Leave a comment

Calculate LOC by shell script

Navigating to you project folder, run(python project) find . -name “*.py” |xargs grep -v “^$”|wc -l If it is a Objective-C project, the the script should look like this: find . -name “*.m” -or -name “*.h” |xargs grep -v “^$”|wc … Continue reading

Posted in Mac, Mobile | Leave a comment

Android context work scope

Posted in Mobile | Leave a comment

Adding an existing project to GitHub using the command line

Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub. Open Terminal. Change the current working … Continue reading

Posted in git, Mac, Mobile | Leave a comment