'How to hide the navigation bar in Android - corona , lua

I saw some ways to do hide the navigation bar but they don't work for me. I don't understand how to do that and where I need to write the code. I saw this:

View v = findViewById(R.id.view_id)
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN)

and also this:

view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION)

but I don't know where to write this codes and I also need a code for hiding it for all the time. for example: like in the game "Jelly Jump".



Solution 1:[1]

You can hide the navigation bar use,

native.setProperty( key, value )

But it has some restrictions, have a look at this to know more http://docs.coronalabs.com/daily/api/library/native/setProperty.html#androidSystemUiVisibility

Solution 2:[2]

In order to hide status and navigation bars:

display.setStatusBar(display.HiddenStatusBar);
native.setProperty("androidSystemUiVisibility", "immersiveSticky");

In case Android's version is < 4.4 (KitKat), at least status bar will be hidden. There are other tags you can use. The full description can be found on my blog post.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kumar KS
Solution 2 lomza