Looking for something like uPnP for Angular web client - angularjs

I have an Angular web client on a dedicated hardware device. Every device has its own landing page.
On the landing page I now want to have the option to select other devices in the same network to log in (by calling its own web client).
What are good approaches to realize this?
I think of a solution that is not IP based, somethink like uPnP. Every client should broadcast its own presence and all web client landing pages will show the same devices.

Related

Connecting a mobile device to IOT system in a home

I am interested in building a device that will be connected to my home network and I will be able to control remotely via an app on my cell phone.
My original thought is this:
Both systems will pull data from some cloud service
My mobile device will modify a data entry in the cloud service
The device will be constantly pulling this data and update the necessary setting when they change
Concerns with the original thought:
Constant pulling of the device in order to see when data has been changed (inefficient)
No way to communicate from the device to the phone (feature limiting)
Question:
What is the best way to create the link between my mobile device and the device that will remain in my home?
Potential similar architectures include Nest, Ring, etc.
The concept is correct - typically, IoT devices and mobile apps communicate through the cloud. There are cases when you want to connect your app directly to a device (e.g. through bluetooth, LAN or sometimes even internets), but that is done usually for a specific reason, e.g.:
IP cameras generate a lot of traffic, putting it through a centralized server is very expensive, so cheap home products do P2P from mobile app (centralized served could help you get the IP address for your camera)
TV with phone as remote control. Using cloud service hear would be weird and limiting access to LAN simplifies the setup
In general cases (Next, Ring) you can be pretty sure the IoT devices talk to the cloud, instead of the mobile app directly. It both offer more feature (as the data can be processed in bulk in cloud), but there's also benefits for using the cloud even if it's used only to relay data.
In many cases, you also want to limit traffic (e.g. save batteries or data plan). Two key aspects to be able to do that:
Don't waste time setting up a connection. That means connecting to a stable cloud service (your mobile might not be online) and using optimized network (e.g. LAN with static IP address, NB-IoT or LTE-M)
Choose optimal M2M protocol. Two popular M2M protocols are COAP ("light weight HTTP") and MQTT (a messaging protocol)
Once you've set up how both your device and mobile app can exchange data with the server, it's up to you to design how to use that. Note that there's nothing stopping from the device to also push data to the server - all connection (IoT device <-> cloud <-> mobile app) can use two-way protocols.

Can I redirect all web requests from Android through a proxy server?

I'm trying to set up the proxy server in Android, where every web request should be first sent to the proxy server, which then decides whether to send the original page or a page optimized for faster mobile downloads.
I looked into mirrorrr, which seems to be a proxy server on the App Engine. If I go to https://mirrorrr.appspot.com/techcrunch.com the page loads, but if I set the Chrome proxy server settings to https://mirrorrr.appspot.com, and then go to techcrunch.com, then no webpage loads.
How can I get every single web page to redirect to my app domain (example.com), so I can take action on my server and send a more optimized page (compression etc)? I think this should be a solved problem, so looking for a possible plug-and-play open source solution.
Thanks!

How to do authentication in hybrid mobile app develped using Meteor, Ionic, Angular, ngCordova

What's the best way to implement authentication for mobile app that will be secure and also wont annoy the user by asking to authenticate every time the app starts? In other words, for the first time after installing the mobile app, the user needs to register/login, and after that the app always works without asking to authentication.
Native mobile applications ask for credentials when using the app for the first time, but subsequently they don't require login. The app just start and try to connect to data network (wifi, 3g, etc.), if it finds the data network then it loads the latest data, else uses the data that it was able to fetch last time it could get access the data network. Also, the app is able to reconnect automatically when data network is available and fetch the latest data with out user intervention.
I tried to develop similar features using meteor mobile app (accounts-password, useraccounts:core, useraccounts:ionic), however the app quite frequently times out and asks for re-login everytime the data network is lost. Sometimes it even hangs on the login screen and the only way out is to kill the app. The behavior seems very similar to a web app, where a session id is created and has an idle timeout, or forces login when internet connection has issues.
Any tips on how to store the credentials on first login and use it subsequent; and also good way of handling data network when disconnects are frequent?
Frameworks:
1. Meteor Platform
2. Ionic with AngularJS
3. ngCordova
Code Structure:
1. Common directory, where all the meteor method calls and schema definitions (simple schema).
2. Application files are organized as per guidelines (client,server, resources).
One of the solutions I found on stackoverflow:
Send the UDID or mac address with the initial login details to your server. create a unique token for this user/UDID (or mac) combination and send it back(encrypted) to the device if username/pass is successful. on subsequent access, the device sends the encrypted token and UDID/mac (over secure connection) for re-authentication.
if you want to put paranoid people at ease about tracking UDID, you could instead use the UDID/mac to salt the encrypted token, but this wont be as secure, but should do the job still.
Appreciate your help, thank you!

How are Tabris mobile browser clients created?

Tabris has native mobile and browser clients. I see info on creating the native mobile clients. How do you create a mobile browser client? I would like to use the browser for things that wont need access to native device things like the camera. I know how to create a standard desktop client using Eclipse RAP.
Tabris' native mobile clients are faster and look nicer (native widgets) on mobile devices. Using a browser on mobile devices to access a RAP server is often slow or suffers from buggy mobile browsers. That's why I would recommend to always use the native client on a mobile device instead of a browser.
In case you want to try to access the RAP server with a mobile browser, just enter the IP and entry point in the URL field of the browser. The RAP client is then fetched via http as it is embedded in the first page you receive from the RAP server.

How do Mobile Apps communicate with a server?

How do Mobile Apps communicate with a server? Does this communication happen over HTTP or are there other methods (for instance, I guess a mobile app could open a socket)? Does this differ form device to device? Is there one most commonly used approach? If the communication happens over HTTP how do the URLs look like? Is there a way to identify the app based on the the "User Agent" in the HTTP request if the communication is happening over HTTP?
Mobile Apps can communicate with a server in many ways. Mobile apps can also use other features of the mobile. For instance SMS , MMS. Its pretty open really. Your question could be "how do computers communicate with a server?".
A mobile app can be a simple as loading a web page. This would be http.
The problem with mobile apps. They run on phones. There are lots of different phone manufacturers and its up to them (in some case the mobile phone operators also have weight) what to allow the programmer to do by the choice of operating system.
If you are getting started with mobile apps. Take a look at android its pretty simple to get going with if you know a little about programming.
As for the useragent. It depends but usually if you are using the http api on the phone, you can set the user agent to what ever you want it to be, its just a string.
Hope this helps!
Communication usually happens over http. Applications usually identify themselves in the User Agent field

Resources