Use an intent from another Android application or use code? - android

I am writing an Android application that uses some functionality that has been published under the Apache 2.0 license. The functionality is available in 2 ways:
As java code
As an intent in an Android application.
Being the typical developer that I am, I don't want to make the user install a separate application so that they can use my own application - because it would definitely put me off using the application if I had to.
On the other hand, doing the work to get the application up and running using the Java code will take much longer.
My questions are thus:
What are most developers doing now? Are they using intents from other apps?
Does it matter to the average consumer that they need to download a separate application to make it work?

In my application EmailAlbum, I first depended on the presence of OpenIntents OIFileManager on the user phone to pick a file on SDCard or chose a destination folder for exporting a generated file.
Later, I integrated my own version of the code of OIFileManager in my app's source code for several reasons:
Depending on another app for basic (but essential) application features is like a suicide. If your app can't really live without the other app and this app is not installed on most devices, your app won't get used. Most people want apps that work on first start.
Another app was on the market which was providing it's own (bad) implementation of the same intent and was making my app crash... users having it installed on their phone thought that was my app's fault.
Providing a consistent UI was not possible.
I think using public Intents is great to allow people to chose from various applications to extend your applications features or to reuse the content generated by your application. BUT your application has to be able to live on its own, depending only on standard apps provided with ALL android devices (ie. not even depending on Google proprietary apps if you want your app to be able to be used on devices which have not been approved by Google, those which come without the Android Market or GMail).

Most developers are going to use a common intent (phone call, web browser, camera, etc.) to call an activity. If your app replaces one of these common intents, then you shouldn't have anything to worry about.
Developers do sometimes include intents to use other (non-common apps). One example that comes to my mind is OpenWatch that provides an API for other developers to build on. Of course, in this case, if you are using a bluetooth watch like this, then you most likely already have OpenWatch installed, therefore it isn't much of a bother to get another app that builds on top of it.
If you think people are going to use it, I'd say provide an API.

Might also want to take a look at here: http://www.openintents.org/en/
I think even google had an app at one time that depended on a third party package. At application startup the user was greeted with a dialogue that asked him to download said package. If he declined, the respective functionality was disabled.
But I'd only use that approach for tech savvy users, the regular joe will much likely be put off by it. If the functionality isn't crucial, just use it as an added bonus and leave it out otherwise.

Related

How are Android Instant apps started/loaded?

I am trying to understand at a little bit lower level how Android Instant Applications work, as well as analyse a bit the security aspect. I know you create an app, it has its modules and activities, and you need to specify an URL entry-point for each feature module. Now, I have my application, I have my link, I browse to it. Two questions here:
1) How does Android, my browser, DNS, whatever parses that link, know that it's not a normally browsable internet link, but that it's actually an instant app and and should open it like an instant app using the android framework, download base and feature modules, isntant-compilation, etc. ?
2) What does it actually do after it understands it's an instant app? What calls are made? WHERE exactly is the application contained? We start from the browser we use to search and find that link, after that? Is it contained in that browser's sandbox? Does it create a new container for that app? From a security perspective, this information would be quite important and interesting.
How can I gather more info about all this? Are there any tools that allow me to see into these load procedures? Any link to some extra documentation or knowledge of how this particular aspect of android works?
I suspect there won't be much public info because even though they were introduced in the end of 2016, Instant Apps is still a very new and explored feature, but that's exactly what I'm working on. If there is anything that can allow me to see what's going on, tools, debuggers, stuff I don't even know it exists, please let me know.

Android App to modify function of other applications

I am just getting back into Android programming after a while and I know that separate Android applications are allowed to communicate with each other in some capacity, but is it possible for one to build a proprietary application that can modify the features of an already existing application?
I don't mean applications like those 3rd Instagram applications (which were most likely built using their api ). I mean is it possible to create an application that would for example run in the background and possibly add features on already existing applications?
For example making an extension application for that runs in the background when you use the Twitter application that could potentially add features, or disable existing features?
(Sorry if this is not directly relevant I did not know where else to post this question)
In android apps are sandboxed.
It will be a major security issue if one app could influence the operation of other apps.
What can be done is letting apps interact with each other and exchange information, there are couple of ways to do this that relay on android Inter process communication, Android Binder Content providers and Intents.
What you can do is to draw on other apps. this will allow you to add some functionality without really changing anything in the background app
There are some apps that use this technique. LastPass is a good example.
See this article for more information

How can I allow extensions to be made for my Android app?

If I'm making an Android app (such as a messaging app), and I want the app to be opened up so that other developers can make extensions (i.e. connections to other messaging sites/protocols, additional features, custom UI), what options do I have available to me to do this?
The answer to this question makes it seem like if the other developer makes their own app, my app is able to pull data from it? Is this the direction I should be heading in?
I know such extensions are possible, because I've seen it with other apps, such as the file manager FX that has "add-ons" called "FX Plus" and "FX Root Access". So, basically, how can I also get add-ons/extensions for my app?
Options I am aware of:
Intent API can provide some functionality (You can give developers ability to send commands and data to your app). For example you can accept some kind of XML and build your UI according to it. It's slow process, but you can create some hacks to speed it up. documentation
Content provider you can give other developers ability to work with data of your app. Databases, photos, videos. You can share your's and you can accept new ones.
documentation
AIDL Service never used it myself but sounds promising. documentation

Default apps on Android

Are there any default apps on Android? Especially in 4.2?
iOS 6 has Passbook, built-in Facebook/Twitter support, allowing for greater integration into these services.
Is there something similar on Android that can reliably be accessed across all devices running the latest Android OS version?
I know that there are Android apps that can read the Passbook file, but they're not Google products the way Passbook is an iOS product. Similarly, I know that there are Facebook and Twitter Android apps, but they may or may not be installed and may or may not respond to an Intent that's possibly structured differently between versions of those apps. Am I just doomed to deal with this fragmented space, building for the past and hoping it won't break in the future?
Yes, all Android developers are doomed to this fate. Most Android devices come with things like GMail, Google Calendar, and so on, but Android is fully open, which means not all devices have to include these (and in fact, have gotten in trouble for including them in the past).
Here are some things to keep in mind, though (in 99.999%+ of cases):
The Google Play store will always be installed on the device (assuming that's where you publish your app).
Either the browser or some form of it (Chrome, Dolphin, etc.) will be installed on the device.
And some other tips for developing for compatibility:
I would suggest you read up on intent filters; basically, when someone makes an app like, say, Twitter, they register it for a "share" intent filter. That way, when some app (maybe yours?) requests the user to "share" something, Twitter is shown as an option to share with.
I hate to make a bullet point entirely out of links, but you should read up on Receiving Content from Other Apps, Sending Content to Other Apps, and Sending the User to Another App. These are all key ideas in core Android that will apply to your situation.
Those aside, I have one final note: Assume nothing. Assume everything will break. Whenever you call an intent, you should be wary and catch any issues (such as ActivityNotFoundExceptions).

how to create an app using the functions in other apps

I need ur help..!
I m creating an app in android. The apps use the functions in the other apps which are already present. I want my app to be standalone. I can't use the functions in those app.
To be more clear, If i create an app for making video calls. The app needs to use the functions in the phone apps. can i just create an instance and use the functions or should i redo all the functions which are required?
It will be helpful if i get to know what will happen wen the app is inserted in the code base and compiled.? where ll the R.java file get created?
Could u suggest me some links to get a detail info about it?
developer.android.com is really useful when it comes to explaining the various features of android development, as well as some great code samples.
When you say you are using the functions of other apps, are you using intents or checking if the app is installed?
If there is an app that has the functionality you need, you can always set a home page that tells the user that these apps will be needed or change your application so it uses the features in android and not the third party apps.
Hope that helps!
If the apps don't provide an API or intent-filter for what you want to do, you cannot include/integrate them easily.
Unless you have a license to use components from the other apps and have access to their source code, you are going to have to re-implement the functionality you need from scratch or from a combination of available platform capabilities, libraries, and appropriately licensed example code.
(If you were content to leverage exported capabilities of other apps that had actually been installed on the device, you could do some things via intents. But you seemed to say this was not acceptable, that you needed to take capability from apps that would not be installed.)

Categories

Resources