Is it possible to get data from another application in Android?

I downloaded the application from the Android market. I just need to enter a number and click, this application creates a table with some content.

I want my application to copy the contents of a table. My application called this application. The user must manually place the data in the edit text, and then press enter. My application will run in the background until then.

  • Is it possible?
  • How?

Another question: Can I just take a screenshot of the second screen of the application and then use the image for a text decoder to get the data on this screen?

+6
source share
4 answers

Here is the complete documentation on data storage and data exchange between applications. I doubt that you can share the database, but you can try to do the same using external storage

+2
source

There are two ways:

1) Purpose: if you want to share small amounts of text or numeric data between applications, you must send an Intent containing the data.

2) Content Provider. To offer a file from your application to another application, you need to send the contents of the file URI to the receiving application and grant permissions to temporarily access this URI. Content URIs with temporary URI permissions are safe because they only apply to the application that receives the URIs and they expire automatically.

+4
source

Android isolates individual applications, so you can only interact with other applications through their open services - intentions and content providers. Rooting almost certainly will not help.

The ability to receive data from a third-party application that you know nothing about is likely to be impossible, and taking a screenshot is random and unreliable, even if it is possible.

Why don't you contact the developer and explain what you want to do to make sure that they provide you with a reasonable way to get data from your application?

+1
source

It seems that you want to transfer some data to this application and run it, right? This is possible if and only if this application provides some “hooks” for you to do this.

In Android, you can, regardless of whether the application provides any hooks for you or not, launch the application by doing something like this:

Intent intent=new Intent(); intent.setPackage(TARGET_APP package name); context.startActivity(intent); 

This should start with this application, however, if it does not provide you with hooks, this application will start as usual. In this case, the data will not take effect. If it provides intercepts, you can put the data through intent.putExtra("KEy",value) , and then run this application.

On the other hand, if you want to read some data from an application, it is possible if and only if this application allows it. By default, data created by the application is private.

0
source

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


All Articles