ZFFramework
Loading...
Searching...
No Matches
Android

Requirement

you must have these settings being prepared:

once prepared, it's recommended to follow Quick setup for quick setup your project files

Manual Setup

if you really want to setup manually:

  1. build necessary libraries of ZFFramework, by one of these methods:
    • tools from ~/tools/release
    • manually build projects under ~/ZF
  2. create your own Android project
  3. merge all src files under _release dir to your project's path, or use the Android aar file
  4. set up JNI env like other Android JNI project, especially to specify header include path and so lib path of ZFFramework, which located in ~/_release
  5. in your Android project's AndroidManifest.xml, add these activity declaration to your <application> node:
    <activity
    android:name="com.ZFFramework.Android.ZF_impl.ZFMainEntry"
    android:label="ZFFramework"
    android:usesCleartextTraffic="true">
    </activity>
    <activity
    android:name="com.ZFFramework.Android.ZFUIKit_impl.ZFUISysWindow"
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:label="ZFFramework"
    android:windowSoftInputMode="adjustResize" >
    </activity>
    and these permission:
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
  6. in your Android project, create a loader activity that, load necessary libraries, and start ZFMainEntry then finish itself:
    static {
    System.loadLibrary("ZFCore");
    // all other ZF libs here
    System.loadLibrary("your_app_lib_name");
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    Intent intent = new Intent(Loader.this, ZFMainEntry.class);
    startActivity(intent);
    this.finish();
    }
  7. ensure all of your resource files put in "src/main/assets/zfres" directory of your Android project, and ensured all of them have an extra ".mp2" as file name postfix if they are large than 1M bytes
  8. create cpp files in your project and follow the Tutorial to code with ZFFramework, enjoy