This is an Android noob question.
I am trying to start an activity of another apk through my own application. Now I know I can launch any other application and invoke its main activity. In many cases I'm also able to start subactivities, for example display it's settings dialogue.
However with some applications, for example Facebook or Endomondo I would get a FC everytime I try to launch some specific activity of their application.
Now I suspect that this is a permission issue and that the Facebook or Endomondo devs just don't want other applications to get access to their activities. But do I have to find out which activities I can use and which ones I can't use by trial and error every single time?
Plus: Is there any way around this dilemma? Maybe on a rooted device?
Cheers for any pointers.
As you already said you can only use activities of other apps which are designed to be used by others applications. Normally the developer of the other app define a set of intents and actions their app will be able to understand and process.
Using any other app's activity is by default not possible, this is by design of Android as every app runs in it own sandboxed process (there are some exceptions where apps can share a process).
So to use another app's activities you must know the intents it listen on. Normally this can be found in the applications website or documentation or on OpenIntents a dictionary for intents.
Related
I find this question a couple places on the web, but never with a good answer. Let me be specific in the questions asked.
I want to build a custom Android ROM which only features one app. This app is not to interact with any hardware (per now). This app will be launched on the start up of the device. No locked-screen. The device will have to restart if the app malfunctions.
A resource told me that you can change the launcher app of the ROM.
-> Does this mean that the home screen, the one which displays all apps on our phones, is merely another app? If so, can you simply change the launcher app as it is stated here? What were to happen if this app fails?
If this is the case, it would solve the entire issue.
If not, how do you go about making this sort of project? It includes
Making an app on AOSP
Refuse users to leave the app or interact with anything else
Making this app part of the boot-up process
Remove locked screen
Make the app a dependency of the OS (to force shutdown if malfunction)
Thanks in advance for any replies
I just found Android have a topic about dedicated devices (formerly called corporate-owned single-use, or COSU) are a subset of company-owned devices that serve a specific purpose. maybe that can meet your requirement.
BTW, After into the sub-topic lock task mode that mentions about set DPC whitelist APPs and the device policy controller (DPC) needs setup by other steps.... FYR~
I have a question about controlling applications in Android. I want to develop an application which selects appropriate network bands for each application. I guess i have to grant superuser access but i have another problem. Is there any available java code to do that?? Is there any library or something that you know? How can i do that?
I can list apps in a listview but i want controll them with an switch. There must be connection with the applications by switch
Thanks...
It' easier then what you think. Check out android intents (here) (and here). Intents are a kind of an event bus provided by android framework that can be used to launch applications as well as activities/services/receivers
Is it allowed in Android that developers can access the activities of other apps? For example, can my app get triggered when some other app is put from foreground to background or the other way around?
I checked some websites, they mostly talked about how to manage the activity of your own app....I've read someone's article saying there was an API allowing developers to monitor other apps but it was banned after Android5.0.
So please help! I really have no idea if it is possible...Thank you!
Not without access to the framework can you do this. Android was meant to have isolated processes so that this can be avoided. The only thing you can do is launch someone's else's activities should they follow certain criteria. But once it is launched, its under the process of the app you launched, not yours. You should NEVER be able to take control of someone else's process unless they allow you to via some hooks.
One hacky and error-prone ways is to monitor logs and check which activities are launching.. but this is horribly inefficient.
Have a look at my answer here # https://stackoverflow.com/a/35594313/529691
I am interested in developing a custom Android launcher which would be installed onto a device primarily for censorship. Ideally a device would divert attempts to launch applications to a service which would decide, based on a profile, whether the user would be allowed to proceed, or be shown a block screen/redirected to an informational web page.
Is it possible to detect and interrupt application launches via some kind of background service or attachable listener? Or alternatively, might it be possible to have a launcher launch a different application than the one clicked on, in order to allow for indirection?
Or, if all of this is impossible, can a service running as part of a custom launcher dynamically hide/unhide launch icons based on triggering events/messages?
There is no way to catch an app being launched and redirect that. If you think about all the horrible things people could do with this it's easy to see why. I think you're going about this in the wrong way. Instead of trying to enforce these rules with a custom launcher you should look into one of the Mobile Device Management options that are available for Android or work on creating your own.
Recently my employer asked me to build an app which is to be deployed on the field (for field workers) having features such as:
-when the phone starts the app should automatically fire up and no one is able to make use of other phone's features such as calling, texting etc.
Also, the app should be as such that it cannot be uninstalled.
Imagine a complete restricted access to phone's features except my app; a total lock down situation?
So, how really can I go about this? Will I need to build a whole new custom ROM loaded with my app? Or will I have to make use of app's "permissions" to lock down the system? Which is better?
Where should I start?
My app has to make use of SQLite, GPS, Wifi/2G/3G network and camera access.
Any advice would be appreciated.
Thanks
U can create an application which will be listening for Activity starting event. When u catch this event u can start your own activity. This activity will suppliant uninstall activity. To catch event - use logcat reading
or
If your are going to launch your own android phone, put your application in the android source, like the other native applications like Myfiles, Gallery. and
modify the source, so that in Settings --> Manage Applications there
is no entry for your application.
First of all I should say such a horrible plan
you can not prevent system to uninstall your application. According to your client's requirement you can only do one thing. That is to launch the application when the phone is started by using BOOT_COMPLETED intent filter