We would like to be able to send instant messages to our employees from a Java application. Most of them have a phone with a data plan. Is there a free and easy way to do this?
I investigated using whatsapp, which most employees have installed, but it has no official API and it seems that a recent change also disabled the possibility to use the unofficial API's.
Perhaps there are whatsapp alternatives that provide an API?
Or is the only way to use mail or create my own android + iPhone apps to do this?
You can use Tropo API to send java messages.
Further details can be found below:-
https://www.tropo.com/2011/05/sending-outbound-sms-with-java/
You can use mysms.com API to send free messages. https://api.mysms.com
why dont you try Whatsapp Web Automated with Selenium framework
The following links can be helpfull:
https://github.com/sigalor/whatsapp-web-reveng
https://github.com/mukulhase/WebWhatsapp-Wrapper
Not all companies provide APIs, whatsapp doesnt want its customers to be bombarded with hoards of messages, that's why they arent giving any APIs
But the above links are a few work arounds. Proceed with caution.. If you send unusually high amount of messages you may get blocked
Related
I'm looking for the way I can create a receiver of Firebase Cloud Messages in Java. Things successfully work in Android, but I could not find anything to start in Java.
Official documentation does not mention Java as supported language, but I also did not find explicit statement that Java is not supported.
Here is the documentation entry points for Android, c++ and WEB (Browser). Where can I find something similar for Java?
Firebase Cloud Messaging does not support receiving messages on Java desktop apps.
The protocol was made for delivering messages to mobile (Android and iOS) devices, and then expanded for web clients. It seems unlikely this will be expanded to desktop or server apps in the (near) future, although I'd definitely recommend filing a feature request.
In the meantime, consider using another push technology, such as the Firebase Realtime Database or Cloud Firestore.
check out firebase_admin messaging module, I am able to successfully send messages to my android phone from my python server at home. I know it also allows you to subscribe to different messages. It supports Java but not aware of the technical differences
How can I make an online server to access API's and handle requests? Then how can I have my android app access this online server to make requests?
I have an android app that I am building for a school project. This app will need to use multiple APIs to gather information to display to the user. However I don't want to allow people to decompile to source code and take my API keys. My plan is to build an online application that will do all of this work on the server side. This way the user only submits a query and the server sends information in response to their request. This will speed things up for the user and keep the keys from being accessed by other individuals.
Steps I think I need to take.
Set up server to access the API's
Make app access online server through HTTP requests
3....
4...
I have a very general concept in my head, but I'm not sure where to begin. If I'm wrong on any part of this question please correct me.
I do plan on moving this to the app store in the future.
edit: Do you know of tutorials that show the building of the API and then loading it to Amazon AWS or another server?
There are many options when building restful services for api consumption. You could start with php, which is the easiest to start with. Here is a nice tutorial that takes you through the initial stage all the way to the end of building login system for android using mysql and php as the server language. It contains the barebone details of setting up the infrastructure and logic. I think from there you manipulate and go further.
https://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
check out java rest easy, it is a nice tool to use to build web API's. You can host it for cheap at red shift or amazon using their pay what you use billing.
The cheapest way for you to host your REST API is to use Amazon's API Gateway. You pay for what you use and pay nothing if it is not being used. API Gateway plays very nicely with Amazon's Lambda service that allows you to run discrete code units - again, you only pay for what you use. Lambda itself plays nicely with Amazon's pay-as-you go NoSQL datastores (SimpleDB and DynamoDB).
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.
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.
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