Posts by Chang Park

How to create custom framework APIs


On this post, we will learn how to modify or create framework APIs on AOSP (Android Open Source Project).

Before start, let’s set a build environment and download AOSP source codes. Please follow steps on these links (environment and source code).

  • Make sure that you have at least 200GB of a free space.


Path to Work on

…/framework/base contains all framework libraries and APIs that we used to develop an app, e.g., So, all of our work will be done under this path either to modify existing framework APIs or to create new framework APIs.

(Will be updated) Framework APIs

(Will be updated) JNI (libraries)


Files Generated

After done with modifications, please follow these steps to build. Then, you will see these three  files generated.

Under <aosp-root>/out/target/product/<product-name>/system/framework/,

  • framework.jar: APIs accessible to applications
  • services.jar: Implementation of managers and system services located under frameworks/base/services.

Under <aosp-root>/out/target/product/<product-name>/system/lib/,

  • libandroid*.so: Libraries generated from native code (C/C++) like the .cpp files located at frameworks/base/core/jni.


Using Modified Framework APIs

After modification, we want to use the new framework APIs while building an app. However, current version of framework APIs that our machine uses is not updated yet. That means  our IDE cannot find the APIs. So, please replace files under ~/Library/Android/sdk/platforms/android-{version #}/This path can be different on your machine.


Frameworks supporting to develop cross-platform mobile apps


Recently, multiple frameworks support developing cross-platform mobile apps. This means developers can reuse the written code on different platforms using these frameworks, and it helps to reduce costs significantly. On this post, I will talk about the differences between these popular frameworks.

Four popular frameworks

There are four popular frameworks which are Flutter, Xamarin, ReactNative, and Titanium. For easier understanding, I drew a comparison table.Screen Shot 2018-07-01 at 2.51.05 PMXamarin, ReactNative and Titanium are similar but using different languages. Flutter is the latest framework from Google, and its key feature is providing full UI stack implementation without using native UI components. This means UIs will be exactly the same on different platforms. Other three frameworks link with original framework, and that means UIs will be slightly different on different platforms. Also, Flutter is fast and smooth because of no need for linking with original frameworks.

Integrating with third party libraries

Class-form supporting frameworks usually have issues with integrating third-party libraries. Complex apps use multiple third-party libraries, and this limitation is critical. However, Flutter supports linking Flutter APIs with third-party libraries, and those codes using third-party libraries should be written in specific languages of the libraries. That means these codes cannot be reused across other platforms.

Common misunderstanding

A lot of people get confused with characteristics of ReactNative, Titanium, Ionic, PhoneGap and Cordova. Even though they all use JavaScript, they are different. ReactNative and Titanium are frameworks for developing cross-platforms and link JavaScript with original frameworks. They do not use WebView. However, Ionic,PhoneGap and Cordova use WebView and also have native source codes. These are called hybrid apps.

Ionic, PhoneGap and Cordova are sometimes called frameworks for class-platform because they use html, css and JavaScript which are class-platform.



Types of apps and frameworks

Screen Shot 2018-06-30 at 7.45.44 PM
Native Apps are built with native APIs from specific platform such as IOS, Android, and BlackBerry.

  • Pros
    • High performance.
    • Supports push notification and full device APIs.
    • Interactive and intuitive.
  • Cons
    • Platform dependent. Developer should work with different codebase for different platform.
    • Hard to maintain.
    • Expensive developing cost.
  • Frameworks that support cross-platform


Web Apps use html, css and java scripts and can be accessed via a web browser over a network such as chrome and safari.

  • Pros
    • Low developing cost.
    • Easy to build and maintain.
    • Cross-platform because it is accessed through internet browser.
  • Cons
    • Performance issues such as lagging.
    • Less interactive and less intuitive.
    • Limitations of device utilities such as bluetooth, NFC, camera, biometrics and sensors.
    • No push notification.


Progressive Web Apps are advanced version of Web Apps. These apps support push notification and offline functionality. This support is important to keep people using your app after initial usage. Still access through internet browsers. 


HybridApps are built with html, css, and java scripts and run inside WebView. Also, they have native source codes. These apps cover limitations of web apps. There are multiple frameworks that support to build hybrid apps(e.g. PhoneGap, Ionic, Cordova).

  • Pros
    • Support push notification and have access to device utilities using APIs.
    • No browser needed.
    • Faster development than native apps.
  • Cons
    • Still have performance issues.
    • More expensive than web apps.





Shell is a program taking commands from a keyboard and giving them to operating system.

Below are three popular shells on Linux.


  • Bourne Again Shell. The most commonly used shell on Linux.


  • Enhanced C shell(csh).


  • The newest of the shells. Compatible with the Bourne shell. Has powerful completion features.


Virtual Consoles

linux terminal

Virtual Consoles enable multi-user logins on a single machine. For example, you can login with your account and also as a root.


By default, most Linux versions provide virtual consoles with these keys.

Ctrl + Alt + F1 – F6: Virtual Consoles

Ctl + Alt + F7: A console where X server is running.



  • is an application that manages one or more graphical displays and input devices(mouse, keyboard, etc.)
  • works as a server.

You have probably heard about X11, X server, or X window.

All of these mean the same, and X11 just means eleventh version of X.


You can use a command ‘w’ which shows a list of currently logged-in users. 

w result

tty represents regular terminal.

pts represents pseudo terminal slave(e.g. ssh connection).



Methodology: Qualitative vs. Quantitative


These two terms can be used as research methods.


  • used to gain an understanding of underlying reasons, opinions, and motivations
  • provides insights into the problem or helps to develop ideas or hypotheses


  • used to quantify the problem by generating numerical data
  • uses measurable data to formulate facts and uncover patterns in research.
  • much more structured than qualitative.


How above methodologies can be applied in research project:

  1. Formulating hypotheses (Qualitative) – Can initiate a research by discovering the problems or opportunities people are thinking.
  2. Validating your hypotheses (Quantitative) – Can get numbers to apply statical analysis for validating hypotheses.
  3. Finding general answers (Quantitative) – Helps to get definite answers for broad questions.
  4. Incorporating the human element (Qualitative) – People’s own words can help to uncover blind spots.



Down Call vs. Up Call


Down Call

  • User code(unprivileged) enters to kernel with trap(interrupt).

Up Call

  • Kernel(privileged) enters to user code with IPC(Interprocess Communication).


White Box, Black Box, and Gray Box


In software testing, there are three different types of testing depending on how much knowledge the testers have on the software being tested.

White Box Testing

  • With full knowledge of the software. (internal structures, source codes, etc.)
  • Usually tests how the software performs.
  • Suitable for software developers.

Black Box Testing

  • Without having any knowledge of the software. (internal structures, source codes, etc.)
  • Usually tests for functionality of the software.
  • Suitable for third-party testers.

Gray Box Testing

  • Test with partial knowledge of the software.

Testing Methods


These are currently popular methods to test software.

Fuzz Testing

  • Input massive invalid, unexpected, or random data(Fuzz) to find errors or vulnerabilities in the software.
  • Effective on blackbox testing


Stochastic Testing

  • Input random sequence of datas 


Model-based Testing

  • Generates meaningful test case models which can detect errors on the desired behavior.


Symbolic Testing

  • Replace inputs of program with symbolic variables.
  • Find the feasibility of all paths in the program.
  • Quite expensive for finding feasibility of path.
x = read();
if (x > 3) {
  y = 1;
  if (x < 0)
    y = 2;
} else y = 3;

After changing with symbolic variables, it checks the feasibility of paths. On above example, the expression (y = 2; on line #5) will not be reached.


Concolic Testing (Concrete + Symbolic)

  • Input actual concrete value to the program, then generate new input by changing the path condition.
  • Less expensive then Symbolic testing.

What does the symbol ‘&’ mean in C and C++?


‘&’ symbol has two meanings in C and C++.

  • Address of Operator: returns address of a variable.
    • int a = 3;
    • printf(“%d”, a);
      • will return value of a: 3
    • printf(“%d”, &a);
      • will return address of variable a.


  • Bit-wise Operator &: operates on bitlevel
    • Example:table_bitwise_operator
    • int a = 13&4;
      • 13 = 1101
      • 4  =0100
      • 13&4 = 0100
      • a = 4