Loading...
Logo
Processing Forum
Hi all,
It's a small program for android phone. When I  define the dimension of the display window with size(displayWidth,displayHeight), the status bar disappeared. 

How can i into full screen and keep the status bar?



Replies(3)

Good question.
Fullscreen is defined in PApplet superclass onCreate method, so i tried to override it. But in whole method there is one field that is private in PApplet so i cannot override the method. This field is handler.

So, question to developers (i know you are probably very busy doing more important things) and those of you folks,
who are experts in java: is it possible and safe to set handler as a public field in PApplet, so OnCreate can be overriden from inside processing sketch? ( PApplet.class line 250)
ok, tried this myself and modified PApplet source, compiled core, made handler public, overriden OnCreate, but cant get it working, so far.
i must read more about overriding methods in java, im really a newbie. maybe this is not possible because im trying to override method that already overrides and calls superclass ( http://stackoverflow.com/questions/4595512/java-calling-a-super-method-which-calls-an-overridden-method).

--edit
got it working!!!:) on modified PApplet, altering few lines of code that allows to switch flag fullscreen from inside processing sketch. im glad that i managed to do it somehow, i will need status bar to be visible in one of  my projects:)

and here is how to do it:

1. go to http://code.google.com/p/processing/wiki/BuildInstructions , get processing source code from svn

2. in PApplet.java (yourLocalCopyOfProcessingRepo/processing/android/core/src/processing/core/PApplet.java) in line 420, just before OnCreate add:
Copy code
  1.  public boolean FSFLAG = true;
3. again in PApplet.java around line 444 replace
Copy code
  1. window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
with:
Copy code
  1. if (FSFLAG) window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
4. read link in step 1, compile. its easy. go to yourLocalCopyOfProcessingRepo/processing/android/core/ and type ant in terminal. new file processing-core.zip will land in YourLocalCopyOfProcessingRepo/processing/android/. raname it from .zip to .jar, then copy your new core to your project.

5. in your sketch add this before setup():
Copy code
  1. public void onCreate(Bundle savedInstanceState) {
  2.         FSFLAG = false;
  3.         super.onCreate(savedInstanceState);
  4.     };

Thats all, your sketch will run as usual but status bar will be visible all the time.


@tyxiang: if you are in hurry i can send you modified and compiled processing-core.jar

question to devs - do you think it is reasonable to push this to repo as a feature for those of us who sometimes really needs more native look integration in processing?
Thank You   alexanderjanas!You are  powerful and enthusiastic. 
I think it should be used as a built-in parameters.
I am a novice for java, Please send  processing-core.jar  to  my mailbox: en1434@gmail.com
Thank you a lot.