Detect Twitter submit Android

I am currently writing an Android application.

I intend to launch my application against the background of my phone, and I want it to be able to detect when I send a message using the Twitter application on the same device.

Is it possible?

+5
source share
1 answer

When you create an OAuth client key in managing Twitter applications (url https://apps.twitter.com/ ) - this is one of the preliminary steps for implementing authentication, you will define the source field there (see the example in the documentation from https: // dev. twitter.com/overview/api/tweets ), which will be reported in all tweets published by the API of your newly created Twitter application. Therefore, when you receive your tweets, you will find those that were sent by this particular application (on your phone). More generally, I published an open source Twitter app for Android on github: https://github.com/giuliohome/TweetSearch just look at the API call, where I get a Tweet source for more details, basically simple

jsonObject.getString("source") 

In the same field, you can find tweets published by the official Twitter application for Android on the same device, assuming that this is the only Android device from where your username clicks with the target application, otherwise I do not know any legal and standard way to detect a physical device

+2
source

Source: https://habr.com/ru/post/1263589/


All Articles