Callback Function

Image a senario, you have several threads executed at the same time, how can you know some threads are already finished? Maybe you want to execuate a thread after another thread, then how can you control the flow? Here, we can use callback functions.

A callback function is a function passed into another function as an argument. The purpose of it is to inform a class Sync/Async if some work in other class is down.

In java, we can implement calbaks by interface. Here is the steps:

Continue reading

When we have customized strings in an Andriod App, where are you store them? Some people choose to assign strings directly in the code. However, cosidering a good desgin patern, Andriod separates code and resources. Most of good Android developer put strings in strings.xml which is located under res > values. This is because we can easily manipulates and customize values.

Continue reading

Understanding the storages in an Android device, you can easily check or transfer files in both directions: your app and the device. For example, if your app have a licence file, and you want to check the permission, you can store licence file in Android device for further updating and changing.

Continue reading

Based on the article I wrote: Decode Android Project from APK, we know that revise engineers can easily decode codes and get your source files. there are a number of possible vulnerabilities for unprotected mobile applications, such as insertion of malware, intellectual property theft, priacy and data theft. Therefore, we can use ProGuard or DexGuard to protect. This is a way to apply multiple obfuscation and encryption to make our source codes unreadable.

Continue reading

If an Android App not doing encryption or obfuscation, an APK (Android application package) is easily be decoded. A reverse engineer can see its source codes and XML files.

Here is the procedure how to decoding .apk files to get source files.

  1. Go to project, Build -> Build APK(s). After .apk file is generated, click “locate” to the path of the file.
  2. Create a new folder, let’s call it “decode”.
Continue reading

Sometimes we use third-party library, or we implements a module and want it to be a part of our main code’s library. In both scenarios, we can import a library as a module.

How to import a library in Android Studio?

  1. File > New > Import modlue > add the library path.
  2. Change library module gradle:
    1. Change “apply plugin: ‘com.android.application’” to “apply plugin: ‘com.android.library’”
    2. Remove applicationId.
Continue reading
Author's picture

Amy Zhu

To learn without thinking is blindness, to think without learning is idleness.


Mapsted Software Engineer


Toronto, ON