Sending a RESTful url (endpoint) from Band - microsoft-band

I just have a general question. Can you send a url from a button on the band. I have a home automation system that you can trigger events by sending a RESTful url (endpoint) to. Basically I can put the url in any web browser and trigger the event. It would be great if this could be done through the Band. I don't really need a response from the Url, just to send it.
Does that make sense?
Thanks,
Scott

No, the Band communicates only via Bluetooth to (applications on) its paired device. On Windows (Phone), the application must be running, with a connection to the Band, and subscribed to the Tile button pressed event in order to receive such notifications. This generally rules out scenarios that require ad-hoc input from the Band unless you're willing to use voice commands via Cortana.

But i think its possible by creating custom tile and handling custom tile events. Haven't tried it in my project but can see from sdk documentation.
For android you can implement broadcast receiver and listen to tile events. Check: sdk doc
Chap 9, page 51

In short, yes it is possible.
However, the problem would be that the button would be single use to only send that ONE URL command and it actually wouldn't be done via the Band.
You can create custom layouts for your applications with the Microsoft Band SDK which will allow you to create a button. You'll then need to register to the click event from the Band which then would get fired on the device the app is running on. From there, you'd be able to send the URL but it would be sent from the Windows Phone or Windows PC rather than the Band so you'd need to be connected. The documentation covers how you can do this here: http://developer.microsoftband.com/Content/docs/Microsoft%20Band%20SDK.pdf
A downside to doing this with WinRT is that as soon as the app is closed and the connection to the Band is lost, your button click won't have any action. The best way to get around this is to create the connection to the Band in a background task but unfortunately, you can't keep hold of the connection to the Band for an infinite amount of time and you'd have to live with the possibilities that you may have times where it doesn't work. I have a GitHub sample which shows you how to connect to the Band in a background task for an indefinite amount of time.
The Microsoft Band has really been developed for the Health aspect and collecting data rather than interactions with other apps which it does in some way support.

Related

How to capture wechat group incoming message and save it

need some advice from wechat experts.
How to get all incoming message from a specific wechat group and send it to server db.
Is there any available api or need to use xposed and hook the function of wechat.
Plz advice. Tq
I dont know the specifics of wechat but if it is an Android app you can always intercept its text and images.
Check if the following suits your needs: angel bitbucket.
It is basically an Xposed module that intercepts TextViews and ImageViews in apps. It then sends them from the 3rd party apps to a standalone stub (running in the Xposed app itself). This stub sends them to a nodejs server that shows them in "real-time" in the browser.
Note that by default it is set to only intercept a few apps (whatsapp, facebook...) and while i made it modular, you will still have to build it yourself.

Push Notification When App is closed/Quit including

Can anyone please so let me know precisely that how can I accomplish the task in which I need to show Push Notification to user when App is Quit/closed?
Currently, I am able to get the push notification done when App is running in background or opened. But App couldn't receive Notification when it is quit/closed by the user.
Right now, it's a really critical task on my shoulders. It's pretty clear do tell me in case if you guys need me to brief in details.
I am having a very hard time to believe that your scenario is Really the following:
When the app is either: open and in the foreground, or open and in the background, you are able to receive a notification to the device, and have its contents displayed in the app, but
When the app is quit (as in not running), the notification does not arrive to the device at all.
I have tested several devices and several push-enabled applications (event source, tag-based). The notification does arrive to the device, after the user subscribed to either a tag or by logging-in (in the case of event source-based), after which sending a notification always arrived to the device.
I don't understand this sentence:
my app logouts with the user
You need to be CLEAR in your explanation. Is there a logout button that the user clicks? If yes, are you also for some reason perform an unsubscribe API invocation? If no, edit the question and provide DETAILED, step-by-step reproduction instructions, AS WELL as provide your application, or any code that you use so that it could be inspected for possible issues.

Use GAE background thread to trigger SSE to multiple web clients

All,
I have completed the basic GAE "Guestbook" example which uses Google Cloud Endpoints and Google Cloud Messaging. I can successfully add a note to the guestbook and have it appear on all registered devices.
I've also used the super simple Server Sent Event (SSE) mechanism to have a web page initiate an event source and then update itself as events are received. But separate web pages appear to create their own distinct event sources (even if using the same URI to the event source) and thus get their own events at their own times.
The objective here is to create a bit of collaboration such that user actions can come from an android device or a web page and the effects the received action are then pushed to all connected users/devices/web pages.
I have assumed I will need a background module and that both Endpoints and 'normal' web pages / queries would channel the received user action to that background module. I believe I can get that far. Next, I need the background module to trigger a push notification to all interested parties.
I believe I can trigger a Google Could Messaging event to registered Android devices from that background module.
But it isn't clear to me how a background module can be the source of an SSE, or how the background module can best communicate with a foreground module that already is the source of an SSE.
I've looked at the Google Queue API, but I have a feeling I'm making something quite easy much more difficult than it needs to be. If you were not going to 'poll' for changes from a web page... and you wanted to receive notifications from an SSE source when changes were made by other users, possibly using Android devices rather than a typical web page, and the deployed application is running on the Google Application Engine, what would you recommend?
Many thanks,
Randy
You are on the right track, not really sure why you are using the background module but from what i understood you need to:
Your front end module receives an update
You retrieve a list of all devices receiving that update
Use the Queue service to send the update via GCM to every single device
Why use queues? because front end instances have a 1 min time limit per request and you'll need to queue work in order to go beyond that time to serve you (potentially) thousands of users.
Now, If you already have a backend instance (which does not have the 1min limit) you could just iterate over the list and send all messages on one request. I believe you have a 24 hr request limit so you should be OK. But in this scenario you don't have need for the front end module, you can just hit this server straight up.

Capturing http data packets on chrome as long as browser active

I'm trying to develop a chrome extension which will capture http packets, their source and destination URLS, the packet size.
Basically I want to know how much time the user spends on a particular site for the duration the browser is active.
I used JNetPcap and successfully have written a java code for the same but i cant find a way to implement the browser close event in Java.
Also chrome extensions need to be in javascript.
Can anyone suggest a way to go about this?
Your initial approach is flawed to begin with. What do you mean by "time spent on a site"? The page loads, packets cease to flow, yet the user is still reading the page. Just network analysis is hardly a good metric.
And what about external resources? Do your users "spend time" on Google Analytics website when trackers make their requests?
If you are dead-set on network capture, chrome.webRequest or chrome.webNavigation APIs should let you tap into requests made by the client.
As for implementing this properly as a Chrome extension, it should be trivial. You can use chrome.tabs API to keep track of open/active tabs.
Declare "tabs" permission to get access to URL data
On initialization, query current tabs (or just the active tab)
Listen to onCreated for new tabs, or better yet for onActivated for change of visible tab (possibly do so with windows too, there's a separate API for that)
Within the active tab, track URL changes with onUpdated
If you're new to extension development, start with the Overview. Good read, and a good hub to other documentation.
As for recommending JavaScript resources, I'll pass; too many of them.

How can I launch an external application from the Browsers (IE, Firefox, Chrome, Safari) in windows

Is it possible to embed an external application inside the browser (IE, Chrome, Safari, Firefox) so it will look like a native web application but actually having access to the USB ports of the client machine? I have heard that I need to make an ActiveX control. I would like to use the .Net framework, but if that is not possible, maybe using Java or C++ will be fine.
I have to make an application that will allow to the users to connect an external device to an USB port, this device will take a backup of the information contained in a SIM card and send it to the user's account online agenda. So the user can restore it later using the same application. This should be a web application or at least look like one.
If the first is not possible. Is there any way to launch an external application from all the browsers, and then pass information to the browser window to allow it to refresh after the backup has been made?
Thanks for your help in advance.
First off this seems to be a big security issue and hence this is the reason why you might be finding it tricky.
What I would do is look at it from a different angle; what am I trying to achieve? How is the user going to use the data? Where is the user going to use the data?
From you question I have answered those questions with the following; I hope I've not miss interpretted anything.
I want to copy the data from an external sim card to a central location
I want the user to see this data from the central location; preferablly from a web application.
The user is going to see and use the data from the web app
Assuming all of these things are true; one design option is the following:
1 - Have a client based application which can read stuff from the usb device
2 - Have a secure webservice which the client based application can upload the data too
3 - Have a web application which can view this data and see refreshes
Let me go into bit more detail for each step.
1 - If you write a small client application it is installed or at least runs on the client computer. Due to this it can access the local client resources such as usb and interface with them. This will mean they can read the sim data throuogh this app, buut also potentially save it locally as well as upload the data. To access the web service they would enter their username/password so you could authenticate them for the upload.
2 - This web service would do the authentication from the client application, but also receive the data submitted from the client app. Acessing web services from .net now a days is really straight forward. Using this web service the client application could also do some checking to make sure the data has been updated and it could handle re-tries if the network dropped etc.
3 - The web front end of the system would interface to the same data source. This site would take the username / password to authenticate them on the site, but also let them see the uploaded data. As for the refreshes; if the user is logged in and looking at the data you could have a javascript timer polling an action/service to see when new records have been added etc. This could then display a message through jQuery or similar to notifiy the user. This could be similar to the notifications which StackOverflow gives when you visit for the first time or get a new badge etc.
Hope this helps :-)

Resources