start chrome packaged app in fullscreen mode - javascript

Im working on a chrome app, currently testing it using developer mode. Im trying to open my app in full screen whenever user click on app shortcut (chrome -> Apps -> MYAPP). I've managed to do this on button click using requestFullScreen() method but it can only be done when user loads the app and click on fullscreen button. What i want is to launch the app in fullscreen mode. Is it possible to convert that onClick eventlistner to onLoad?
Any help will be highly appreciated.
Thanks

You can set the state option to "fullscreen" when calling chrome.app.window.create. Note that you will also need to declare fullscreen permission in the app manifest.

Related

Is it possible to check if the user is trying to exit the page on iPhone?

Is it possible to check if the user is trying to exit the page on iPhone via Javascript?
So basically when the user swipes up the home button and the Browser Window is shown in the app gallery mode? Is there an event for that?
No there is not in my knowledge.
I don't think there is a way we can see if a person is trying to get out of a Javascript page in an iOS software.

how to check mobile web browser is running in foreground or background on mobile device

I am creating angularjs html5 application.
A small query, can we make use of pause\resume events in mobile web application? or answer my query how to check if browser window has focus in "mobile web browser"
I got reference
how to check app running in foreground or background in ionic/cordova/phonegap
I am totally unaware if cordova\ng-cordova can be used in mobile web browser, if someone can guide me that will be great help. I want to basically track any event when application is active such as
- phone call is received
- home press button.
All these events I want to track in mobile web browser.
Add cordova background mode plugin
cordova plugin add cordova-plugin-background-mode
Once the plugin has been enabled and the app has entered the background, the background mode becomes active.
cordova.plugins.backgroundMode.isActive(); // => boolean
For more information check this link : https://github.com/katzer/cordova-plugin-background-mode
Steps are as follows:
First you install cordova-plugin-device, as cordova-plugin-background-mode is dependent on it. After this install cordoba-plugin-background mode
cordova plugin add https://github.com/katzer/cordova-plugin-background-mode.git
Now that you've installed both of them, inside your controller add this code
.controller('HomeCtrl', function($scope){
if(cordova.plugins.backgroundMode.isActive()){
console.log("Background state");
}else{
alert('HELLO');
}
});
Step 2 is the way you can debug if your plugin is working or not. In the 'if' block do what you want to do in background mode.
Add this controller to an HTML page which is called every time. Like I have added this controller on Home.html.
Tell me if you got any problem.

Sencha touch, open weblinks in a new browser window

How can I make all the weblinks in my Sencha touch project open in a new browser window? The problem is that each time someone taps on a link, they are opened in the same embedded browser in which the app is running and there is no way to go back to the app.
For example, if I have a support page hyperlinked via tag in a label, let's say
<a href="support.com>Help me!</a>
When the user taps on Help me, the support page opens in the app itself and there is no way to go back to the app!
EDIT:- I am testing with android device
Try something like
support.com
I think you should have the InAppbrowser cordova/phonegap plugin installed to get it working on this way.

Is there a onExit or onDestroy method on Phonegap 3?

Does Phonegap 3 includes a method "onExit" or "onDestroy" ? I would like to perform some actions before the app closes.
Basically, I want to kill an admob.
Well, after some exploration seems like phonegap api have no such event as onDestroy. This functionality could be implementat in some states for android, course a bit creepy, but in iOS this is not avalible anyway.
Android logic:
if user presses the home button app fires pause event, but application is not closed, so window.onunload will take no reaction. From this point phonegap app's webView doesn't recieve any event. But if user presses back button on first page or application was closed programmatically window.onunload must fire. I think there is a way to realise some kind of native callback by creating a java background process.
iOS logic:
In iOS, application can't close itself by some kind of apple sequrity statements. So app never closes untill user do this by double pressing the home button and killing the app. By some reasons apple dosen't allow apps do anything in background, excluding push notification recievement. So app can detect only it's transfer from foreground to background
I think all you have is onpause/onresume

keyBoard does not disappear on Tapping on Fb feed share button on iOS 5 device

I m using HTML5 and JS to build the app.
In app i have facebook feature, after login to facebook when i use post to wall feature, the feed dialog comes and after entering the text when i tap on Share button the SoftKeyboard of iOS does not goes off. Same app when i run it on iOS 4 device it running properly, I tried to set focus to other element like other button of the app after getting the response of post to wall in the callback function but it did not work
I also was facing same issue but when I updated Phonegap1.7.0 the issue was resolved.

Categories

Resources