In several applications I have downloaded and installed from the Android Market I have found that there is a feature, this feature allows you to share information created by the application to other applications and services.
For example, I can use an application called Instant Heart Rate (IHR) that measures my heart rate, and if I click on the "Share" button I can send the image produced by IHR to Facebook, mail, and some other applications as well. This list of applications seems to fill automatically when I install more applications to my mobilephone.
What I want to know is, what is this feature called? I want to add this to my applications, both the sending and the receiving of information (images and texts mostly).
Thank you in advance for response.
What I want to know is, what is this feature called?
An ACTION_SEND Intent. Here's an old blog post of mine describing its use.
Related
Illustration:
How do I pass data coming from a form in my app to a third-party app?
Also, what are the terms, functions and APIs about doing this?
It is possible through Intent and URI.
The app that is receiving your data should support be open to receive URI so that you can fire up the Intent method it will open the app and send data.
You can refer: https://developer.android.com/training/basics/intents/sending.html#java
Unfortunately there is not a one-size-fits-all solution to this question, as such you are going to receive a variety of different "solutions" but the truthful answer is, it depends on the implementation of the app built by the other party;
Intents
If the third-party app is open to receiving data through intents, and hopefully the developer of that app has documented this somewhere. This would be the most streamlined approach.
It is important to note with this implementation that if there are specific apps you have in mind to connect to, and your application is going to be publicly available, then the user will need to have those specific third-party apps installed. This is easier if you only have one specific third-party app in mind (you can check the user's device to see if it is installed and inform them), and gets exponentially more cumbersome for every additional application you wish to connect to, not only due to having to instruct the user about yet another required third-party app but also as you will need to make sure you are able to pass all the necessary data to a completely different application.
Have a look at this earlier question to see how this can be achieved.
APIs
Another solution would be to use APIs. Just like intents, this requires the third-party developer to have exposed their application to these specific API calls, which you can then connect to to pass your data. The simplest real-world implementation of this approach would be signing on to an application using a social media account instead of having to create a separate account per application.
This is less streamlined than the intents approach as it would involve additional steps of posting your data to the API and then opening the other app in order to retrieve the data and proceed.
I am developing an Android based application.
In my app communication between users plays a vital role. My app has
built-in E-mail options as a primary source of communication and I wants
to add WhatsApp option too.
Is there a way to add WhatsApp option inside my app which when chosen opens
open WhatsApp Application? If yes, I would love to know how?
You can first check if WhatsApp is installed on the device. The package name for the WhatsApp app is com.whatsapp.
If it's installed, then you can use an explicit intent to automatically take the user to the app to send a message.
You can not under any circumstances control how the user uses WhatApp. It merely opens the app for use. You may be able to guide a user to a particular contact, but that's going to be part of WhatsApp's api and is not guaranteed.
If it is not installed, then you can either remove the option from view since it simply can not be used, or send them to the play store to download it.
WhatsApp, to my knowledge, does not have an open API, so you can not directly integrate the service in to your app. You'll always have to be taken out of it.
Alternatively, you can also send the message as an SMS through an implicit intent. This will allow the user to use whatever messaging app they want so long as they handle SMS.
Currently I'm working on a project where I need to know with who the user is chatting with, in any given time, in chatting apps like Whatsapp, Facebook messenger, Skype, line and other chatting apps.
Could that be done? Is there any API that I can work with to know this information?
No there is not a way to do this. There is no standardized interface for accessing this sort of information. It would be a privacy and security concern if there was.
Specific apps may individually decide to expose a Content-Provider or other means to share this data, but that would be up to the choice of each app, and each would be implemented in it's own way. As far as I am aware, none of the three examples listed do this.
Sorry for my poor English. I have a problem & search for this several days :(.
I have to port an app in Android to iOS. It has a function about sharing to other user : users can send a text message to their to present current app, like : "Good app, visit ... to download".
In Android, this function allow user choose one app from all apps in device can send text message (Message, Viber, Skype, ....). It shows a popup with list of apps.
It's like this image :
It seem to be default behavior in Android, these lines of code is very simple. But in my iOS, i can't find the same way to make it ? I need your help ?
How can i get these app in my app, i have read about "url scheme" - it can help me go to other app from my app. But most important is i don't know what apps can't send text message in device.
A quite similar option on iOS that compared to intent is to use
UIDocumentInteractionController
See the documentation here:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/Reference/Reference.html#//apple_ref/doc/uid/TP40009304
For social sharing only (Facebook + Twitter) you can use the SocialFramework on iOS6 or above:
https://developer.apple.com/library/ios/documentation/Social/Reference/Social_Framework/_index.html
The functionality that you're describing in Android is the ACTION_SEND Intent. You can read more about using this Intent to send text content to other apps in the Android Developer Training guide entitled Sending Simple Data to Other Apps.
As you seem to want this functionality for users to share the app with other users, iOS has the Social Framework for Social Sharing, or you could use a custom UIActionSheet to present the user with your own list of options.
Is it possible to create a listener to get a message from whatsApp in android?
I mean like you have a broadcastReceiver to listen to incoming SMS in android...
Is any API is needed for that thing, or is it legal thing to do or I need to get any permission from whatsApp?
Whatsapp did not publish any official APIs.
There's this open source API for communicating with whatsapp, it's not official and might stop working if Whatsapp update their protocols.
https://github.com/venomous0x/WhatsAPI
Regarding the legality of using this or other non-official API, it depends on the service agreement that you agreed to with Whatsapp. Read it and see if they frown upon using their communication protocols with clients other than theirs. My guess would be they do not allow it.
UPDATE: This GitHub repository seems to have been taken offline due to legal threats.
It is possible, an example of an Android app that does this is Snowball - basic notification manager that can access WhatsApp message content. I'm not quite sure on how that works, but research Snowball to get more information on how it works.
It is also possible without Android, the source repository on GitHub has been taken down and put back up a few times due to legal threats.
If you do, however, manage to connect to WhatsApp's servers to access incoming and outgoing messages with a desktop app and you don't hide it well, your account will be blocked. WhatsApp notices accounts that send messages faster than it would take for a normal person to send - easy to notice because a human takes time to type, try delaying messages by a random number of seconds to try and hide this. Also note that WhatsApp's terms of service state that you may not run any automated system using the service, i.e. any external app. You may not use the service to advertise or spam (raises red flags pretty fast and gets your account blocked).
There is also another library written in Python which you can use write custom application.
It also has terminal client and you run it in interactive mode and also supports group messaging.
There are lots of issues to fix.However you should not be abusive with whatsapp service.Don't use it to spam users.This is reverse engineered library and therefore unofficial.
Here the link:-yowsup