Legacy Android Installation & Setup

This documentation is for an old version of nativeCSS. For the latest versions of nativeCSS see the latest documentation

Android installation and basic styling (minimum Android version 2.3.3)

setup-android

Installation is simple.

  1. Unzip nativecss-0.1.zip

  2. Drag into your project’s libs folder (you may have to create this).

  3. Refresh your project and check the files have appeared..

  4. Add the line.

    import com.nativecss.NativeCSS;

    to the top of your activity’s class.

  5. Add the line:

    NativeCSS.styleWithCSS("view{background-color:red}");

    to your activity’s onCreate method

    Android versions 2.3 to 3.2 require additional installation.

    All activities must implement onResume() and onDestroy() as below.

    This is due to lack of support for the ActivityLifecycleCallbacks before 4.0.

    We recommend extending the base Activity classes to implement these methods only once. Alternatively, this github project has tried to simplify this process.

  6. Start the app! It should look a bit like this:


Well done, you have successfully installed nativeCSS.