Need help working with Phonegap (Cordova actually) - javascript

I've being working with Node.js and Angular.js. But now I am moving into mobile (Android) and I would like to solve some doubts before getting started because documentations have being quite confusing. So here are my questions:
How will the mobile app connect to the backend? is it just configuring the config.xml file?
How is the Login system suppose to work when talking from the mobile to the backend?
Does the Login system allow to use the Notification API's? Which variables should I consider?
What limitations would I have when working with Javascript? Like Underscore, D3, Three.js, etc...
If anyone could answer these questions I would really appreciated

1) It depends on what you refer as "back-end". I assume you re referring to some remote server connection. As Cordova is fully based on HTML,CSS and Javascript, you can use some ajax calls to connect to your server(back-end) to get/put data.
2) For my apps, for login system, I use ajax based solution to callback my remote server and validate the login username and password.
3) Yes. You can use the features of Alert, Beep, Vibrate and even push notifications. Refer to the corresponding API docs.
4) Virtually no limitations on what use as long as its javascript and does not create contention with other javascript codes you use together.

It will connect to the backend the same way your web apps do, what transports do you usually use?
Logins will work the same way your web apps do.
There are no limitations on javascript, it will be very similar to developing for the mobile web except you will have more device APIs available to you and you will have the ability to create custom device APIs.

Related

HTTP Request Mobile Javascript

Hey everyone so I have a question, can I have an endpoint api in my Mobile application?
For example I have a server that would do stuff with data and then I would send a post request to my mobile application letting it know new data had came in. How would I go about that? Is that even possible?
My solution I came across was to use firebase api since I remember It has a watcher. So I can easily change some data inside the firebase database by using my server. The mobile application will have the firebase watcher and see that something in the FB database got changed and it will proceed to react to it.
Without using firebase. If I were to send a get request to my server from my mobile application every second(as a watcher) is that bad practice? Or is that pretty much what firebase's watcher is doing?
I know that when you deploy a web application you can have a backend inside the directory. Would mobile applications even allow that?
Is there a simpler way?
also note
I'm using Ionic framework so its a javascript framework
And I'm using nodejs/express as my server
If I were to send a get request to my server from my mobile
application every second(as a watcher) is that bad practice? Or is
that pretty much what firebase's watcher is doing?
This is a bad practice and that is not what it is doing.
I know that when you deploy a web application you can have a backend
inside the directory. Would mobile applications even allow that?
You can't have easily a backend in your mobile application. You can call it but not having one inside your application.
Using Firebase is the good practise.
If you want to create your own server, you can create also a firebase cloud messaging server.
What you are doing is called push notifications. More infos here : https://stackoverflow.com/tags/push-notification/info

how can i access mail from a microsoft exchange server using javascript?

I am trying to build a desktop app using electron that retrieves mail from a specific mailbox (microsoft exchange server), now, i have looked around and read that mailbox connection should be done server side (the question was made by a guy building a web based app that is a little bit similar to what i want to do), but, since i am not really deploying a node js server but rather using electron, which, as far as i understand is like a desktop app version of node, im not sure on which approach to take. Should i use an api? does microsoft has any interface for this? or should i use a third party integration for it?
It looks like the Exchange Web Services API is only provided as a CLR assembly, so if you wanted to use it you'd need to:
write a C# console app that you then spawn from your Electron app
(and communicate via stdin/stdout), or
use the EWS API in your Electron app via Edge.js
Alternatively, you could probably just directly communicate with the exchange server using SOAP messages, but that could be a bit tedious to implement.

Real Time Background Service

I am now developing a mobile app using ionic framework and it's using larvel 4 REST API to do CRUD operations with MySql database. Based on the app requirement, the mobile app needs to call backend service everytime in order to complete certain process.
I am using Angular Resource to call those APIs and i am calling them every 3 secs using Javascript setinterval function. However, the app is working, I don't really feel that it's a good practice to do because it's a heavy task for both server and client.
Could you guys please guide me how I should solve this kind of situation and i really appreciate your help. Especially, which kind of tools I should setup and what are they? Thank you.
setInterval isn't a best practice to receive new data from your API server/DB because the server could get flooded when too many users access your web site. However there is a prettier solution: WebSockets. With websockets you receive notifications realtime. I am not a PHP developer so I don't know what WebSocket libraries are used for Laravel/PHP development. But on the AngularJS part I can recommend this: https://github.com/gdi2290/angular-websocket
A WebSocket example (non-related): http://jsfiddle.net/EAVvQ/24/
Hope this helped.
Cheers!

HTML5/javascript X11 server?

We have an application which consumes a large amount of data. Currently a desktop app, but we would like to deliver it via the browser.
It doesn't make sense to me to create a web app where we need to transfer a ll the data used for the visualizations.
We're looking at RDP and some products out there that provide RDP access via a fully javascript client. They seem to work well with our app, but I've been thinking about what it would take to move off Windows.
Switching the front end so that it could run under Linux would not be trivial, but not impossible, so the main stumbling block would be delivery.
I was wondering if there are any X11 javascript servers out there, but have not found any leads.
Use xpra's builtin html5 client, it supports any application you can run on an X11 desktop.
You can use an HTML5 VNC viewer like https://github.com/kanaka/noVNC coupled with a VNC server like RealVNC
AFAIK, recent GTK has been ported to HTML5+Javascript in Gtk Broadway
And you could make your application a web application, for instance by using Wt, or by making it an HTTP server thru specialized HTTP server libraries like libonion, libmicrohttpd etc.
By using AJAX techniques (e.g. thru jquery) your application won't transmit all the display data to the browser at once (but only incrementally and only the actually shown data).
You might also consider fastcgi as a way to connect your application to some web server.
I know two, both at very infancy:
https://github.com/GothAck/javascript-x-server
and
https://github.com/ttaubert/x-server-js
Both need simple tcp-to-websockets proxy in front, but all X11 logic happen inside web page and all x11 objects exist and interact within browser (so it's not just remote framebuffer but real server)
You can ever run full Linux distribution in Web Browser, but that's require to run x86/ARM emulator and GNU/Linux inside it. It provides X server with possible web connection too.
For very simple applications you can use libgreattao toolkit and tao-network-client to connect to it. I'm the author of both project. The API isn't yet frozen, but it rather behaves stable. You can read about it here:
https://nintyfan.wordpress.com/2015/04/30/server-buildin-into-libgreattao-and-tao-network-client/
It can provide some problems with applications with a lot of data, because all elements must be send to client, when it were created, but instead we don't send full graphics(only icons is send) and user interface could be changed quickly. It also don't support mouse enter/leave/move events.
I must tell: do not download tarbar, but download version from svn.
Sounds like the easiest approach for you is to get xrdp, which is an RDP-server for X. Then you would use your RDP client to connect to it. I think Nomachine NX supports html directly now, but I'm not sure. There was talk of an html X2go-client, but I don't know anything about that either.

ASP.NET MVC - Automatic notifications when a record is modified?

I have just used the NotifyIcon class in a windows application and I think it is really handy. I'm predominantly a web developer so I just wanted to find out if there is anything similar to this for a website.
The website I want to incorporate this into has a Ticket Management module where users can capture tickets/problems and then get responses to these tickets from my client's employees who handle the ticket.
Obviously I realize that the notification or pop up will need to be shown in the page, but is there a way to put a timer on the specific page, or even the Master page (maybe javascript or JQuery), to poll the database every few minutes and check for recently modified tickets and let the logged in user know that a ticket has been updated?
Thanks in advance.
If you need the client to keep an open connection to the server and poll it, I think Signal R will be your best bet for integrating into an .NET project. It is on Nuget but source is at https://github.com/SignalR/SignalR.
I would recommend familiarizing yourself with Node.js.
Node.js is a strong tool that aids in leveraging javascript as a real-time server management tool.
After you've gotten yourself familiarized with the Node.js setup, you'll want to grab Socket.io. Socket.io provides suppport for the long-polling technique by leveraging against your websocket created by Node.js. Here, we can manage the conditions at which we serve data. This is a huge tool on the developers side in battling against 2 HTTPD ports.

Categories