Communicating with blackberry from website - java

I would like to make a way to communicate with my blackberry to call a vibrate alert and a led alert through my website. What would be the best way of doing this? Would it be using java or html5? Can you just give me the fundamentals. I am not looking for any detail.

In this sort of situation, where there is only one BlackBerry involved, I would suggest you just integrate some email send functionality into your web site, and send your BB an email.
I'm not an html expert, but if you were doing this in Java, you would either register for a push Service:
BlackBerry Push
or write some polling service that ran in your BlackBerry and checked a web page you had set up.
Both of these options I think are significantly more work than sending an email.

Related

Facebook Messenger - ChatBot - wit.ai integration

I have my application running on AWS on tomcat instance with Java code with mongodb database.
I now need to integrate this with Facebook messenger ChatBot and wit.ai.
I am really struggling to get started, some sample code i have found but in different languages.
Can i run this and integrate with my portal running on Tomcat. it should call both Facebook messenger and wit api.
I need to get high level idea as to how to proceed.
To connect wit.ai to your facebook page, you just need to create an accound with wit.ai, and then create a new application (or use the default starting one).
Then you can go to the settings of the app, and you will se the Server Access Token code.
You need to paste that server access code in the field "Integrated NLP", that you will find in your Facebook for Developers account, then access the application that you want to use NLP, in the setting for Messenger. For that you must have the messenger app already created and configured with it's webhook wich I guess you have.
Once that's done, the Natural Language Processing (NLP) will be sent to your server automatically as another field in the message. And it's preety simple to understand and train from wit.ai
The messages of the user will be analyzed by wit.ai, and if it finds any entity of the default ones or one defined by you training the bot from wit.ai, will send it to messenger, and this one will insert the NLP in the message.
So you will recive a normal JSON message from messenger, with an extra field called NLP that will contain something like the following example:
"text":"reservar una pista","nlp":{"entities":{"tipo_cita":[{"confidence":0.98398202482107,"value":"pista","_entity":"tipo_cita"}]},"detected_locales":[{"locale":"es_XX","confidence":0.9935}]}}}]
My chatbot is in spanish, but there's an example of how you can see the NLP in the JSON message.
I introduced the text: "reservar una pista"
And it recognized the value: "pista" with a confidence of 0.9839. Wit also detected the language "es_XX" that's spanish with a confidence of 0.9935.
First of all think about what your bot should do. What functionality will it provide, which questions will be asked by users and how you would like to respond to that.
If you have a general idea about your problem space you can start thinking about the technical challenges.
Be aware that both the Messenger Platform and wit.ai are completely independent products and they provide an HTTP interface to their service. That means you can use any language you like to interact with these platforms. Your application acts as the middleman to these services.
Start off establishing an integration with the Messenger Platform so you that you are able to both receive and send messages.
For that you have to create a Facebook page which acts as the identity of your product. Users will find you in Messenger by your pages' name. You also need to create a Facebook app where you subscribe to your page and specify the webhook settings so that messages are relayed to your own backend service.
The documentation for this is really good and I advise you read it carefully. You can find it here.
After going through the docs you will have a good understanding of what you can do with the Messenger Platform and which types of messages you can send and receive.
Once your able to send and receive messages you can start to extract some sense out of them. For this you can use wit.ai, but there are also other services you might consider. E.g Google just released their own NLP platform which provides similar features. See here
Also there is api.ai
In general you have to send received messages to the service of your liking and get back structured information about what the intent of the user is and what values where extracted. With that information you can act accordingly.
If you want to stick with wit.ai go through their Getting Started guide and recipes section. That enabled me to use their platform.
I hope this gives you a general idea about how an integration could work. This is fairly high-level and much of the details (especially on the NLP side) depend on your specific use cases.
You can use a sample nodejs implementation of witai and facebook messenger from their official repo. First of all, you have to train the model of witai to understand expressions and extract entities. Then set up the messenger bot on fb and attach it to some fb page. Once you are able to get the messages from the webhook callback send them to the witai API. You will also have to define actions in your code for the witai to execute actions defined in the model.

Testing GCM in simple JUnit-Tests

I searched a lot but I found no solution. I'm pretty sure that it is not possible but maybe one of you how you can do this.
I have a Server that can send Push-Notifications to my app. Therefore I use the Google Cloud Messageing Service https://developers.google.com/cloud-messaging/
Unfortunately the rules for when a notification should be sended are not that easy. So I would feel a lot better if I could write JUnit-Testcases that can subscripe to the project and receive these notifications. And it would be very helpful if I could test this against a real system.
Howoever it seems that you can only recive push-notifications in real Android and IPhone -Apps. Additionally there is a Chrome-App thatcan do it https://developers.google.com/cloud-messaging/gcm
Is there any possibility to receive a GCM Push-Notification in a Java desktop application?
Since there seems to be no Solution for this I wrote Something that suits my needs. Feel free if to do anything you want with this:
https://github.com/codemaker219/gcmproxy

How to create a server for Android app which receive and transmit data to my application without socket?

I want to create a java server application which receives data from an Android client and also transmit notification to client. Actually i did not know much about server apps. I am quite familiar with servlets and mysql, is there any tutorials based on these??
So any suggestion how to build it or any tutorials for it?? please help me!
What you are probably looking for is Google App Engine a SaaS by Google. While there are many alternatives this is probably the best route you can take for implementing a Java based backend. Follow these tutorials* and you'll be good to go. Keep in mind the GAE is a bit complicated and will take some time to get on your feet.
https://cloud.google.com/appengine/docs/java
More tutorials on GAE can be found by a nice google search!

Is there any method same as gcm to be used for desktop application?

I want to make one desktop application for our college so that it can be use in the way so that when we want to send update about the college fest it can be directly reached to all the person who have the desktop application in java.
For android we have the GCM concept. Is there any method for the desktop application also?
I do not want to use polling here .... So please tell me any suitable method how to do this?
Not without running a server of your own. GCM is a particular service that Google runs free of charge to encourage developers to use the Android platform, and it works by having every Android device make a TCP connection to Google and keep it open all the time waiting for incoming messages. You'd have to have your own similar server.
You could use a JMS publish/subscribe topic, but in this case, it is almost certainly a better idea to let the client poll for updates in JSON or RSS format. Is there a specific reason you don't want to poll?

Asynchronous android GAE communication using restlet

I would like to repeatedly (every second) ask for the message (object or value) to GAE (if android client did not create or change something there) from another android device. I need to check it pretty fast, but I know that it happens aproximately once in hour.
I use restlet and I don't want to create new thread and poll by get from this thread every second, because this is very battery consuming. I also don't want to use C2DM.
Is it somehow possible to do this? I have found something about NIO nonblocking http connectors here:
http://restlet-code.1609877.n2.nabble.com/Push-data-from-server-using-a-live-HTTP-connection-td2906563.html
But here is described only the client side and I also don't know if this solution would even be possible to use on GAE and how. Does anyone know more about this approach?
Thank you very much in advance.
As the author of uniqush, I created an entry in the FAQ page specific to this question.
Can I use uniqush on Google App Engine?
Yes and no.
If you just want to use GCM on Google App Engine, then there are some code in uniqush-push which you can directly use.
However, because Google App Engine does not support socket connection, there is no way to use APNS. In another work, if you want to setup a server on Google App Engine, you cannot push any notification to iOS devices no matter what software/library you are using.
I did considered to port uniqush to Google App Engine. But because of this fact, I think it may be better to port it until Google let us use client-side socket connections, or provide some way to connect to APNS server.
Again, if you are considering to use Google App Engine as a server for your App, please be aware that you will not be able to push notification to any iOS device right now. If this fact does not bother you, then do it.
Personally, I recommend you to run a server with full control. It is not expensive nowadays. Amazon EC2 or similar cloud products may be a good choice to run uniqush.
As I recommended above, using a (virtual) server with full control would be a better choice if you want to support more platforms besides Android.
If there is any other question, please feel free to reply.
For being future proof I would suggest you have a single push notification service for both kind of devices. You can either build on your own, or leverage something like uniqush or this
Also the Urban Airship's SDK would be a good option to look at, more details here
this is similar to Urban Airship but only a fraction of the cost. The API allows you to send a C2DM message to a user via a call. After you implement the broadcast reciever, when a user installs the app they are prompted to accept the message. If they accept a token is sent to the C2DM server identifying the user. This token is then used to send them a message via the C2DM platform. The Zend PHP Framework has built in functions for this but if reliability is a concern go with an external provider like Remote Queries or Urban Airship

Categories

Resources