CodeNinja
CodeNinja

Reputation: 847

How to use app functionality of other app in our app

Before i ask my question i will first explain some background information.

Our company is developing an app for iOS and Android. Our customers can decide to use our app (branded) or integrate our functionality into their app. As our app has some complex algorithms and communication protocols on-board. For this reason we want to provide a kind of SDK for our costumers who wants to integrate instead of using our app.

As we use BLE, NFC and GPS, we decided to make our own apps native. The issue is that many of our customers already have an app which will be a hybrid app in the most cases. So "just" making an SDK for all platforms is almost impossible, not only to build but even more to maintain.

Another important thing to keep in mind is that we want avoid that our customers need to understand our complete communication process, even stronger we won't give our algorithms or communication protocols to others because this is what makes our app/product unique at this moment.

So now the concrete question. Is it possible to provide our functionality as a kind of API so other apps can use the functionality of our app like a kind of API? This means that our app needs to be installed also on the end users smartphone but they don't need to use it individually. The idea is that the app of our customer communicates with our app like an API, our app does the communication with our hardware and gives back the result to the app of our customer. Note that user of the app should not see our app in foreground. (I have the idea from some games who requires "Play Games")

I know there is a way to exchange data between apps (Inter-App Communication) but can this also be used like kind of API?

Upvotes: 2

Views: 442

Answers (2)

Kuffs
Kuffs

Reputation: 35661

Obviously this answer relates to Android only. (You may want to ask a separate question for IOS)

At its most basic, a Content Provider is used to exchange data. However, nothing prevents code being run in the provider host to extract that data.

For example, You can host a Content Provider in your app which when called with specific parameters, performs a number of your complex functions and returns a simple table of data (MatrixCursor) or even just a simple True/False response within that cursor.

You could further simplify the usage of this by creating an Android Library that your customers could import into their own project to make it more friendly and API like by adding methods and functions to the library that then delegated their calls to the Content Provider or even to a Broadcast receiver in your main app which could then respond with its own broadcast.

You could even make use of invisible Activities. i.e Call an activity in your app that has no UI.

Even more preferable would be to create your callable code as a self contained library that your customers could use which would negate the need to talk to separate apps completely.

Upvotes: 1

noobEinstien
noobEinstien

Reputation: 3283

In my understanding, you need other apps to invoke a particular functionality, say call a web API or open an activity and write something or open a popup dialog and do something.

In android: Yeh, it is possible by BroadcastReciever. you only have to listen to the particular action and perform the functionality.

So the task is, you only have to supply the action.

Upvotes: 0

Related Questions