Add the MainActivity class and test

The application has been tested and can be used.
There might be some low-quality code but the approach may be good.