Move the application to the background on iPhone by PhoneGap - javascript

I realized that iOS is not working on a form that you can close the application.
I work with PhoneGap version 2.2.0 and I do like to have my application exit button,
I thought about the possibility to move the app to the background and back to the iPhone home page when you click on the button to exit.
I did not find how to do it through PhoneGap
is there a way?

Take a look at this post: https://gamedev.stackexchange.com/questions/17709/can-an-ios-application-have-an-explicit-quit-button
It is quite possible, maybe even likely, that Apple will reject your app for doing this. It should be sufficient for users to close the app simply by pressing the home button.
UPDATE: Just because Android has a button for you to close the app does not mean that one is needed on the iOS version. As other posters have said, conventions are different between the two operating systems.

There is already a button to exit -- the home button on the device. You do not need to add one in your application.

Related

How To restrict user to not leave the exam window in online exam conduction?

I am Developing a React Application for online MCQS exams. I want to restrict the user to not leave the exam screen until it completes the exam or time goes over.
I used React Full-screen component for full screen,but on pressing the esc button it leaves the full screen.
Is there any other way to achieved full screen rather than Full Screen API.
Or any other way to implement the restrictions of online exam conduction.
Also I want to Handle Some Key combinations like Alt+F4 , Ctrl+Shift+Tab.
I have used the Event Handler for the keyDown for esc button. but it fires after the full screen closes.
Also I have Used Event Handler for F4 and all keyboard keys. but Alt+F4 close the browser.
I think it's not possible to force a website (or web application, respectively) to stay for an unlimited time in fullscreen mode. The reason is pretty simple: user security. As Craig Buckler explains in this blog post:
If you can force an app to run full-screen, the user loses their browser, taskbar and standard operating system controls. They may not be able to close the window or, worse, nefarious developers could emulate the OS and trick users into handing over passwords, credit card details, etc.
I guess the only possibility would be to configure the web browser on a specific computer to always run a certain page in fullscreen mode. But I guess that would require administrator rights and probably not all browsers might have flags or configuration options for this.
Edit: Another option would be to create a standalone executable file that opens a pre-configured browser instance in fullscreen mode. Have a look at Electron for desktop or Cordova for mobile devices for instance. But please note that this might take much more time to build and deploy than just programming the web app itself, if you have never worked with one of these tools before.

show orange Windows taskbar icon orange when a Chrome Packaged app gets a notification

I am working on a Chrome Packaged App that sends notifications (which are now all hooked up). However, when the user is not in the app -- the app is in the background with other windows on top of it -- the notification pops up for a bit and disappears. I would like to change the taskbar icon to orange, the same that the Hangouts packaged app does, so that the user knows there is a notification to view at a later time.
I looked all though the notifications documentation and could not find any such feature, yet Hangouts is using it, and I believe I have seen it in other apps. Does anyone know how to trigger this in a Chrome Packaged App?
Thanks.
It looks like I have figured it out, and it only took all day. This behavior is not part of notifications (that would be too easy), but rather of the app window. So, you would do something like this:
var appWindow = chrome.app.window.current();
appWindow.drawAttention();
This flashes the taskbar icon orange in Windows, and makes the dock icon bounce in OSX.
You can also call appWindow.clearAttention(), although attention would be cleared automatically when the user focuses the window.

Exiting apps in HTML5 &Jquery Mobile

I am trying to create a mobile webapp using HTML5 and JqueryMobile. I want to use one Exit button on which the app should be exited. I already tried window.close() and self.close().
That is not working.
Or it will be okay...back button of device automatically handles the exit option of app?
Anyone have idea about this?
On Android you can use...
navigator.app.exitApp();
As far as I'm aware, iOS does not offer a way to programmatically exit an application.
But really, you don't need an exit button. The devices that the app will run on all have home and/or back buttons, which are the correct way to "exit" apps. Let the OS decide what to do with it, not the user.
Back button is used in navigation so it will just navigate you to previous page in your web view.
You need to handle it yourself in back button handler and call
navigator.app.exitApp()
when you need to exit app.
You can add back button handler with command:
document.addEventListener('backbutton', backbuttonHandler, false);

Accesing softkeyboard buttons with Phonegap

i have developped a mobile app with dojo and phonegap for android. The problem is, that I want to acces the bottom right corner button. I want to change its name to "send" and I want to connect the button with a function. Does anyone have an idea how to do that? Using javascript, or how to do that natively?
Natively it is possible to change the text to certain other limited options however I doubt whether it is possible to do from the context of a PhoneGap app.
Check this post which details the process of doing relatively same but in native.
Android - Handle "Enter" in an EditText
For more detail you need to check the doc

For my website, is it possible to create a button where users can click on it to create an ICON on their iPhone desktop?

User clicks the button, and an icon is added to the iPhone desktop.
If possible, can I activate this button manually?
There is no way for you to do this, because otherwise every developer would do this by invoking it with an automated script and then everyone would just be annoyed. You will have to direct users to press the + sign and then Add to Home Screen.
I believe this is not possible. However a common approach is to detect whether running in an iPhone browser (not as an HTML app) and show a huge arrow pointing at the + sign.
You can take a look at this tool, which is a nice JavaScript snippet giving the user a hint on how to add your homepage as a Icon on your homescreen:
http://cubiq.org/add-to-home-screen
For a live demo visit this page with your iOS-device:
http://cubiq.org/dropbox/a2h/examples/simple/

Categories