I have developed a tiny browser-based app using Jquery and PhP for Android mobile. How can I alert a message in notification area (top of the screen where I can see the message if app main page is not visible) saying something like "The Process Completed". I don't want to interrupt user, just as a notification or reminder in top of the screen.
Thanks is advance.
You're going to have to use Phonegap AND the Status Bar Notification plugin
You mean the notification panel outside of the browser on the home screen? If your app is just browser based, I'm afraid you have no chance to access anything outside of the browser window.
There are solutions to access such features, a popular example being Phonegap but I'm not sure if the notification functionality is part of it.
Related
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.
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.
Right now in web pages I sometimes want to send an alert to the user, saying that an Ajax request was successful or unsucessful. Using Javascript's alert() function works, but on Android it's a large popup that the user has to interact with before continuing.
Some apps trigger a different sort of message. It's a gray rectangle with rounded corners. It appears near the bottom of the screen and is unobtrusive but noticeable.
Is there a way to trigger this from Javascript?
Edit: I'm running a website, not an HTML5 app, and I don't need the undo functionality, just the messaging.
It depends on whether you're running a JavaScript/HTML5 app that uses WebView on your android device or if it is just a website.
If it is the first case, then there is a way to show native Android toast notification using Android JavaScript interface. This exact problem is solved here in Android WebView documentation.
In case you're running a website and you want it to look native on android, you will have to implement a notification on your own and style it so that it looks similar to native toast notification. You can use jQuery UI tooltip with custom styling for that purpose, for example.
You can achieve this by using JavascriptInterface callback in your android code.
This allows you to call android function using javascript, where you can call the function to display your toast.
See this documentation.
I'm quite new of Android and during the development of one app, I have encountered the following issue:
I'm using a WebView inside my app for viewing web sites (it does not matter what kind of site, can be Google or Reddit or anything else). I know I can use a "browser Intent" with Intent.ACTION_VIEW but for the purpose of my App I must use a WebView.
So, I have enabled javascript and DOM api storage with:
getSettings().setJavaScriptEnabled(true);
getSettings().setDomStorageEnabled(true);
My problem comes after that the page has finished loading and some Javascript automatically starts. Basically if the user has already scroll down and the Javascript tells the page to hide/show some content (example a DIV) the scroll resets to top.
My question is:
how can I avoid this behavior? I want that the Javascript loads correctly but it does not interfere with the user's navigation. Is that possible?
Thanks in advance,
Best A.
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.