Skip to main content

Generating and deploying an Android-App

Now an android studio project skeleton is needed for constructing a so-called apk file, which is the format of android app packages, like those on Google AppStore.

    Navigate to cgi_studio_apps/references/Android/ and copy the MlcSample project to a location you like
    From your build directory, copy the file libApplicationLib.so to following location of your project skeleton:
    <MlcProject>/app/native-libs/<architecture>/
    Open Android-Studio and open your MlcSample project. This wil take a few seconds, wait till everything is ready.
    Click at “Syncronise Project” like shown below and wait again till everything is ready:
    (This is only needed when the project is opened the first time)
    drawing-4-1678169637.png

    Next click at “Show Project-Structure” like shown below:
    (This is only needed when the project is opened the first time)
     
    Figure 5 Open the project structure settings
    A dialog opens. Select the tab “SDK Location” and there ensure that the field “Android NDK location” (the bottom-most one) is set to the ndk-r17c, which you installed previously:
     
    Figure 6 Edit NDK location
    Click OK and you’re ready to build and deploy.
    Ensure that you connected your android device to an USB port and enabled “USB debugging” on that device.
    Finally klick the “Run-Button”, like shown below and await what will happen:
     
    Figure 7 Build, deploy and run the application
    Sometimes Android Studio asks for device selection – do so and proceed…
     
    Figure 8 Select the target device Sometimes Android Studio asks to install missing platforms. Simply do so and proceed…
     
    Figure 9 Install dependencies
    And if you’re using an absolutely new platform like shown in the dialog above, Android-Studio still cries around: Simply klick OK to proceed and forget about that:
     
    Figure 10 Ignore problems, it works anywy ;-)
    Finally if the application is deployed and running, Android Studio should look like this:
     
    Figure 11 The app is running on the target