Category Archives: Mobile

Hide implementation of swift framework when distributing

In this article, I will demonstrate how to create a Swift NiceLogger framework and push to Cocoapods without sharing source code. You can download the final project from NiceLogger 1. Create a Swift framework 1.1 Create a new framework project … Continue reading

Posted in iOS, Mobile | Tagged , | 7 Comments

How to generate **.cer** and **.p12** file for iOS push notification

Every time I created a new app with push notifications, iOS, I'm sure I've got everything right and then something refused to work. So this time I'm writing it down so I can't possibly get it wrong again.  Generally, … Continue reading

Posted in iOS, Mac, Mobile | Tagged , , , | 1 Comment


vi / vim 删除以及其它命令 Commands Comments dd 删除一行 d$ 删除以当前字符开始的一行字符 D 与d$同义 d 回车删除2行 ndd 删除以当前行开始的n行 dw 删除以当前字符开始的一个字 ndw 删除以当前字符开始的n个字 d) 删除到下一句的开始 d} 删除到下一段的开始 ndw 或 ndW 删除光标处开始及其后的 n-1 个字符。 d0 删至行首。 d$ 删至行尾。 ndd 删除当前行及其后 n-1 行。 x 或X … Continue reading

Posted in Mobile | Tagged , | Leave a comment

Vim notes

Column selection: Ctrl + V Replace Replace all A with B %s/A/B Find in current line find < f< Remove content between 2 characters For example, remove the content between [ and ]: [routeName] {ExampleRoutes[routeName].name}</Text Vim commands(go to the beginning … Continue reading

Posted in Mobile | Tagged | Leave a comment

React Study

Learn Redux with Wesbos const router = ( ) render(router, document.getElementById(‘root’));

Posted in Mobile, React | Tagged | Leave a comment

How to use Android Battery Historian

1. Install Docker: 2. Run Docker docker run -p 5001:9999 –port 9999 3. Fetch battery report To obtain a bug report from your development device running Android 7.0 and higher: $ adb bugreport For devices 6.0 and … Continue reading

Posted in Android, Mac, Mobile | 1 Comment

Android perssions group 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