How to get notified whenever an application access the contact app - android

I want that whenever any system or user application access the system contact app, my app get notified about that somehow. How can i do that ?

Sorry, but this is not possible from an ordinary SDK app. Any app can access the Contacts ContentProvider as they wish (assuming that they have permission), and there is no way for your app to find out about that.
You are welcome to create a custom Android fork that contains your desired capability and install that on whatever devices you are able.

Related

Is there possibility of adding whatsApp option in my application?

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.

Pairing with apps on the phone

In my application, I want to view data of some of the other android apps(health apps) which are installed on the phone. I know ContentProvider & ContentResolver classes provides this funcationality.
What if some applications do not share their data? How to pair with such apps?
For example how do I pair 'Runtastic' app with my application, pairing as in I want to open another health app(installed on phone) in my application on some button click, also want to access it's wellness related data(steps count)?
Has anybody implemented this kind of functionality?
Android device should be rooted. Without root, you can't access these data.
Content provide and content resolver provide data through implicit intents and you can not access data or other app installed on phone until its api is provided.

Open up another application's database?

Let's say I make an app on Android, is there a way to access another app's database (in data/data/(other.app.package)/databases) with that app and read contents?
I have a rooted device.
The other app should allow you to do that by implementing ContentProvider.
Hitting another apps database directly is not the best idea.
Each application is executed with different UID, so if you will not have rooted phone it will be impossible to achieve.

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.

Is it possible to receive notifications when a contact is added on the iOS and Android platforms?

Question says it all. Looking for a way for a custom app to be able to keep track within minutes of when a contact has been added to the built in contacts database on both of these platforms. For example, if I get an email on my iPhone, and add the sender to my contacts, I'd like for the custom app to be able to know that within a minute at most.
Are there hooks for this? Naturally it would require the user authorizing the custom app to have access to this information.
There aren't any hooks for this in iOS. You can access the address book, but only when your application is running.

Categories

Resources