How to get the content of running applications in Android? - android

I want to make a application that has similar function as Android Beam, but the question is how to get the content of those running apps. For example, if the web browser, Youtube and Google Map is running, how do I get the web address, the video link and the location? Thank You.

You will only be able to get information like this if the running application provides it through some sort of global access method, e.g. a service or content provider. It is highly unlikely that any application will do this as it has some serious security/privacy implications.

You will only be able to develop such an application by writing a system application aka you'll need root permissions.
The best approach in my opinion will be that you look through the Android Beam source code, to see how it's done there. The official API will not help you here. Since the functions used in such system applications is not in the API there is no guarantee that it will work with future versions of Android, so be careful.
I doubt that this will be an easy task. If it's really similar to Android Beam, try building your code on top of the official source.

For Android Beam, the app itself is sharing the data. The NFC background service gets the data to be shared via Android Beam delivered to it by the app's Activities. An Activity either calls at the beginning (e.g. in onResume()) the method NfcAdapter.setNdefPushMessage() to share a static piece of data or it calls NfcAdapter.setNdefPushMessageCallback() to register a callback that will create the data to be shared at the moment Android Beam becomes active.
A number of the standard Android and Google apps have been extended to support this in Android 4.0 ICS, for example Browser, Gmail, Maps, People and Youtube. Apps that have no support for this, will by default share a link to the download page of that app in the Google Play store.

Related

How to add live location tracking in Flutter even app is terminated?

I want to implement Google Map live location tracking to my application. For example I have two users, one is a carrier and one is a customer. When customer want to see where is my cargo, my application will show carrier's location to customer even carrier's application closed. How can I make this logic? I already tried packages like Workmanager. My application will work IOS and Android both. Do I have to write native code for both? If so, I maybe can write for Android but I dont know IOS side. How popular applications like Whatsapp or Snapchat do that? Is it possible to do this in Flutter?
You should have a look on the following package: https://pub.dev/packages/geolocator. It implemented your use-case by allowing background fetching of the position. It even handles the Foreground service on Android as far as I know.

Google Authenticator - User Registration withOUT Mobile App

We are developing Native Mobile Application : Android platform, Ios Platform (Swift).
Instead of asking user to download and install https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_IN mobile app and then generate a QR code in our application to be scanned by this app, we are willing to do it api way. Means We want to call Google Authenticator API pass it QR image, secret and user is registered
Is this Ok and possible. Any one using it please suggest.
I'm not going to say that this is impossible, but integrating Google Authenticator would be a nightmare, and likely wouldn't do what you're expecting it to do. Allow me to explain.
Problem #1
For each instance of the app, you'll have to have a Unique Identifier to pair it to Google's Authenticator. In other words, you'll need to generate a new QR code for each device, pass that off to the system (Which doesn't exist without the app.) to pair the application. This is going to require a "Log-In" to properly store.
Check out this for a possible work-around to Problem #1: https://authenticatorapi.com/
Problem #2
If you're already logging in and the device is already being authenticated, what purpose does the Google Authenticator provide? Well, I'm assuming it allows you to prevent unauthorized access, possibly prevent more than one device. There are infinitely easier ways to manage this, location services are the first one that comes to mind for me.
Possible Solution (iOS)
This is absolutely my go-to method for handling authentication. Encourage or require your users to use 2FA (Two Factor Authentication) attached to SMS messaging. A simple line of code such as this will grab an SMS one-time code.
// Available as of iOS 12, make sure to check version.
self.verifyCodeTextField.textContentType = .oneTimeCode
Android SMS Retrieval
Android Auto-SMS-Retrieval https://developers.google.com/identity/sms-retriever/overview
I don't know it all, most certainly, but I hope this opens the floor for some discussion and brings forth a solution or explanation to your question.
Research Material
Google Authenticator available as a public service?
java API for google Authenticator

Passing data between applications in Android

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.

API used to call receiver app in VideoBrowserActivity

As all of know that Google has launched new APIs for Chrome-Cast which are public.
So while developing it for an android, they have given some sample codes on Github.
While reading documentation of android app, they have clearly mentioned that to launch receiver file on Chrome-Cast we need to create GoogleApiClient and then we can connect to it.
But the sample app uploaded over here, is not calling APIs regarding launching Receiver app and creating Client (or maybe I am not aware of of APIs are being used to call receiver file). So I am facing trouble to write my own app. So can anybody tell where this part is being carried out or can anybody can give me another way to do it and explain me the workflow of that app??
NOTE: I WANT TO DO IT FOR VIDEOS
The sample app uses the CastCompanionLibrary, which
is a library project to enable developers integrate Cast capabilities into their applications faster and easier.

How to embed a mobile application in other application?

I'm building a mobile application for a company and I need to add in the company mobile application a button that go directly in a different application .
Anyone know a solution to embed 1 mobile app in other app???
Inside the code of your button, you can launch an explicit/implicit intent that can launch another application (authored by someone else). The application won't be running inside your application, but to the user, he/she will have the illusion that the other application running is part of your own. This is assuming of course that the second application is already installed on the user's phone. If it isn't installed, your button can just fetch the relevant application's installation page from Google Play for the user to install the app, and then run the application once installed.
In your application, you can also provide a content provider to keep your data. A content provider provider exposes a set of public CRUD interfaces to your data for other applications to access. This is how the contacts database is shared on Android for instance between many different applications, even non-Google applications.
Basically, you first need start at the beginning and educate yourself on the fundamentals of Android. If you start reading about intents and content providers, those constructs may not make any sense to you until you first learn about Activities, the Activity's lifecycle, stacks/tasks, and the way security generally works on Android. You may even want to look on Youtube, there are some very good highly rated Google I/O videos on there that talk about the fundamental concepts of Android.

Categories

Resources