0
votes

I'm building an AIR->android app for a retail kiosk. We are going to hide the 'status bar' so the app is full-screen and doesn't have the soft button bar (it will also be locked into kiosk mode using a 3rd party app).

When I publish and run my app on our device with the status bar hidden the flash stage colour is visible where the original status bar was. This space should be filled with the app contents (full-screen images etc) but the 68px space which originally contained the bar is just solid white (or whatever backgroundColor the stage is set to)

After a lot of trial and error I've nailed this down to the fact that I have renderMode set to direct in the app descriptor xml. If I remove this the app contents fill the screen, but obviously I don't have access to the GPU accelerated rendering system.

I'm assuming this is something to do with AIR asking the device's hardware of it's resolution, which it returns as 1920x1032 even though the actual number of pixels is 1920x1080. So under the hood AIR is only setting up a renderable window of 1920x1032 (when in renderMode>direct).

Does anyone know of a way of enabling true full-screen when in renderMode>direct ?

2
Nothing to do with the render mode, many Android devices return unreliable resolution values, as a consequence it is impossible to count on AIR to give you the correct resolution values 100% of the time. You must use an ANE that will return those values correctly using the Metrics java Class.BotMaster
Thanks BotMaster that seems to be the solution I came across on the Starling forum too so I would imagine it's correct. I haven't had a chance to implement it yet but someone pointed me towards this ANE github.com/mesmotronic/air-fullscreen-ane which is meant to enable 'immersive full screen mode' on android and return the correct resolutions. I'll post up here whether it works or not.Sean

2 Answers

1
votes

An Android MEtrics ANE is one of the simplest to put together. Here's a sample of mine for getting the x resolution. If you have no experience doing ANEs that might be the right one for a start:

@Override
public FREObject call(FREContext arg0, FREObject[] arg1)
{
    try
    {
        DisplayMetrics metrics = arg0.getActivity().getResources().getDisplayMetrics();
        int realWidth = metrics.widthPixels;
        try
        {
            Display display = arg0.getActivity().getWindowManager().getDefaultDisplay();
            display.getRealMetrics(metrics);
            int rawWidth = metrics.widthPixels;
            if(rawWidth > realWidth)
            {
                realWidth = rawWidth;
            }
        }
        catch(Exception e)
        {

        }
        try
        {
            Display display = arg0.getActivity().getWindowManager().getDefaultDisplay();
            int rawWidth = 0;
            Method getRawWidth = Display.class.getMethod("getRawWidth");
            rawWidth = (Integer) getRawWidth.invoke(display);               
            if(rawWidth > realWidth)
            {
                realWidth = rawWidth;
            }
        }
        catch(Exception e)
        {

        }           
        FREObject baseValue = FREObject.newObject(realWidth);
        return baseValue;
    }
    catch(Exception e)
    {

    }
    return null;
}
0
votes

Scalefusion provides the solution in Kiosk Software which enables a feature such as Security and Protection, Remote Management and Mass Deployment, App and User Management, Health Monitoring and Diagnostics & Health Monitoring and Diagnostics.

Our Retail Kiosk Software will mostly be based on a class inheriting from DeviceAdminReceiver and ComponentName. First, we have to tell the system that our app is pretending to become a device administrator. We can do it by adding a receiver in AndroidManifest.xml containing metadata with name android.app.device_admin:

<application 
... 
android:testOnly="true">
<receiver
    android:name=".MyDeviceAdminReceiver"
    android:description="@string/admin_description"
    android:label="@string/app_name"
    android:permission="android.permission.BIND_DEVICE_ADMIN">
    <meta-data
        android:name="android.app.device_admin"
        android:resource="@xml/device_admin_receiver" />
    <intent-filter>
        <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
    </intent-filter>
</receiver>