I have a web application (chat room) in html + javascript that basically sends requests to the server every 5 seconds to check for new messages.
It already works on mobile but there are 2 main problems:
it does not beep (it works on pc) with new messages
when the browser is put on background, the javascript obviously stops being executed, therefore the connection to the server is lost and the client disconnected.
i was thinking of using phonegap not only to make it cross-platform but also to fix those problems stated above. would they be resolved with the use of phonegap?
thank you in advance.
phoneGap doesn't support custom push notification. it basically open a browser and expose you some native support via API.
in order to do some native actions like push notifications and/or sound playing i suggest you check out some of the plugins options available or even write your own for that.
Playing sounds can be done easily using the Media API. As for having the JavaScript run in the background it really depends on the OS. On Android the JS will continue to run if you leave the app via the home button but the back button kills the app so you would stop the JS. It is probably better to write a service that always runs in that case.
Alternatively you'd look at a push type solution to notify you of new messages.
Related
I'm struggling with some Web App recently and have a unusual question.
Is it possible to access terminal via the web browser? Let's assume that I have a button, and when I press it I want to have new terminal window appear.
Any ideas?
If you are running the web app locally, you can tell your server (PHP, ASP.NET, ...) to launch on calling specific url (eg: http://localhost:8080/open/terminal). You can even make a button click event to call that url in the background.
But that's dirty way of doing such things.
TIPS: If you wish to use web technology for desktop apps, use https://electronjs.org/
I'm trying to detect all installed apps on an iPhone from Safari.I have a list of 3000 URls scheme.From a WebView and using javascript, I want to loop this list and save the excitant apps (URls scheme that have a response) .Is that possible?
Simply not possible, as #rckoenes said, it would launch each app you call - therefore halting your browser instance - and looping through that many URIs even if it did return a value rather than launching the app would probably make you no friends. there are ways and means of detecting if YOUR app or AN app is present and launching it via smart meta banners or look at this project: https://github.com/hampusohlsson/browser-deeplink
I am building a push notification on Phonegap. I reviewed the way of using the Push Plugin but it is not supporting windows phone. I plan to use Javascript non stop looping by every 15 mins to query the Rest server and get the message back to display if any message is ready to published. Do you think this is a good idea? Will this cause any app leaking and slow down the app?
You will shoot yourself in the foot doing so.
Why? Your app will only be able to "receive" push notifications if it is active. If your app is inactive, you won't be able to poll for new notifications and therefore won't get any. So you're missing the actual great benefit of push notifications.
Solution: Pull the new version of the Cordova Push Notifications Plugin. Support for Windows Phone 8 was added recently. That's the way to go.
i'am working on a project where i receive data from mobile phones via websockets to a node.js server using socket.io. and this i want to pass to processing. The processing sketch is not running in the browser, it manage sounds, arduino, ... so i wonder what would be a good protocool to send the data to the processing sketch?
I did not found a way to use socket.io in processing, so i thought about using osc?
Or is there a other socket protocoll i can use between mobile phones, node, processing?
thanks!
See if this shield will do the trick for you: http://arduino.cc/en/Main/ArduinoEthernetShield Found a few simple projects from google that seem to fit your description of what you want (turn something on/off from the web).
Node can be your server, with sockets.io, and node can most likely communicate over the web with this shield. Note: I've never used it, just googled, saw a project that looks like what you are interested in.
EDIT: Here is another possible solution: http://xseignard.github.io/2013/06/25/interfacing-leap-motion-with-arduino-thanks-to-nodejs/ using: https://github.com/rwaldron/johnny-five
I am developping an app for Ipad (2 and 3).
The app needs a continuous synchronization with a remote web app. Point is, my app needs to keep "listening" whenever there is connectivity in order to receive updates (lots of data), alerts,... etc.
PS: Before going further I would like to highlight that my app is not targeted to the appstore and moreover it can't rely on push notifications.
What I am confused about is the multitasking on the ipad. I would like my app's local db to stay synchronized by communicating with the remote web app. And hence my questions are:
Does any of the ipads have a real multitasking? (like android's where you can have "services") Meaning that my app or at least a small part of it would still operate even if it is not active on the screen.
How can I achieve that using phonegap standard framework?
If the above points show that at some extent it's not possible. Is there still a possibility to extend phonegap with a plugin and make this happen?
If the above three points are unfortunately fully negative; how would you address the problem by keeping in mind that the syncrhonization involves a lot of data and is mandatory to cover the app's usability?
Does any of the ipads have a real multitasking? (like android's where
you can have "services") Meaning that my app or at least a small part
of it would still operate even if it is not active on the screen.
IOS only has limited background services - in that your app goes into a background state when not active. Really only limited to receiving push notifications. As Phonegap uses a webview and javascript that is only active when the app is active in the foreground.
How can I achieve that using phonegap standard framework?
If you want to keep data connection open you might have to look at development of an application for a computer tablet, rather then an IOS device.
If the above points show that at some extent it's not possible. Is
there still a possibility to extend phonegap with a plugin and make
this happen?
No.
If the above three points are unfortunately fully negative; how would
you address the problem by keeping in mind that the syncrhonization
involves a lot of data and is mandatory to cover the app's usability?
You only option (if you can only use phonegap) is to have the app active all the time, and set a constant sync using Jquery & XML/JSON data. Of course this depends on what type of data you are going to show. For showing a page of data - similar to a webpage you won't have any problems - as long as you understand once you change apps that data won't be synced.
I would like my app's local db to stay synchronized by communicating with the remote web app.
If I were you, I'd be questioning why would I need to do that? Why not just make the app works online? You can have all the assets locally, and just setup some sort of API to retrieve whatever data you need to display on demand.
Otherwise, you'll need to hack your way through to do all the things you wanted, plus you need offline / online syncing. Since you have most data available offline, I assume the app also works offline? And you'll have a really bad time working on offline / online syncing...