Can you send click events to another application? - android

I'm trying to send click events from one application (or service) to another application while it's in the background.
I've learned about the ability to send Intents to other applications. I was able to send an id, that represented a view id inside the receiving android application, and have the receiving application handle the click event. But I'm trying to accomplish this with a receiving application that I have no control of (can't setup intent filters, etc). I understand the security risks with this, but I'm just trying to achieve it for a quick demo, not an actual application.
Is this possible? Maybe on a rooted device?

There are automated Android testing frameworks which allow you to test both white-box within your own code, as well as black-box on other applications. Unfortunately I haven't gotten the chance to try automated testing on an outside app, but presumably you would be able to simulate click events in the same way that you can within your own application.
Perhaps this would be something to look into?
http://robotium.googlecode.com/svn-history/r376/doc/com/jayway/android/robotium/solo/Solo.html#clickOnView(android.view.View)

Related

how to make an app that automate rideshare/restaurants app requests (ex. mystro)

does anyone have any idea how to make an app that automates and filter rideshare/restaurant apps requests? It's kinda working as an umbrella for more than one app.
for example, the XYZ app will be in the foreground and will monitor both Uber Eats and Postmate in the background and whenever requests are received it will show on the XYZ app screen with its details.
I believe it's not doable on the IOS but its existing on android on an app called Mystor. it uses somehow advisability functions in the phone but I want to understand the logic behind it and know how does it work?

Simulating phonecalls, sms, alarm or music in background when testing with Android Espresso

I am testing an app which has a registration flow and I want to test if incoming calls, sms, alarms or other notifications during this flow will create problems. I am using Espresso for UI automation.
I am new at this and have searched quite a bit but don't seem to find a one shot solution to simulate these, I found telnet for calls but I am using a physical device and did not find anything for others.
If there is a framework for simulating these, please help.
Thank you.
If you are testing more than one application, as it seems from your questions where you mention calls, sms, etc. which are assumed to be handled by other applications, you should use UiAutomator instead of Espresso.
You can find more information in Testing UI for Multiple Apps
In case you want to generate those tests automatically you can take a look at culebra.dtmilano.com.
So, as this is still unanswered and may help someone in future.
There is NO framework currently which can do these on a physical device, you can execute shell commands programatically on an emulator for calls etc.
For me, I used a 3rd party app like automate on a different device and sent sms from my app to it and it inturn called me back, you can add most of the functionality required by this. If you dont want sms charges, you can use discover bluetooth and trigger calls when you see a particular device. Add relevant permissions to use these in your app.

scroll android programmatically in all applications

I created a background service on android and I have two buttons which appear on the top of the screen all the time. I want to use these two buttons like scroll down and scroll up. But these two buttons should work on any kind of applications like Instagram, Facebook, Twitter and so. So, it means it should work in all applications that use scrolling.
I search a week on internet but I could not find any solutions.
This is not possible, sorry. Something like this would require your Service to have access to the Views of the applications and this would be a huge security breach, because you could read values from them and so on.
You could achieve this with a custom button code broadcast (so basically your buttons would act as physical buttons on the device) but this would most probably require you to have system-level permissions and some level of cooperation with the OEMs.
Android Activity class has a method called dispatchKeyEvent(), which could let you simulate the key input (with some limitations) but this is not present in the Service class.
Sadly this is not something you can do in Android. Typically you should not be able to touch views with a background service, the point of a background service is that you do some work in it (for example upload files to your web server or get some data). You CAN send a signal from a service once you're finished doing work to tell an app that something needs to happen, however the app needs to be specifically coded to respond to this broadcasted event.
If you wanted to do this with an app that you have developed, that can be achieved by using the onReceive method of say a BroadcastReceiver, however you cannot specifically define the behaviour of other apps as this would represent a security breach in Android.

Android: How to program changes to the standard android sms GUI

I want to write an android app that changes the android standard message sms GUI giving it an extra send button. The one send button should be the usual one and the other should be the one that uses my application to send the message. How do I add this extra button in the android standard sms message GUI? Anyone got an example code on how to do this?
Kind regards
Benjamin
Ok, this you Cannot do for phones which are in the market. You will need to grab hold of the sources and come up with a custom ROM for users to flash.
However, as another option, you can build your own SMS application and let users install so. When users need to send a SMS, they will be asked whether we default/your app needs to be used. This way is a much cleaner approach and more reachable to users.

Control over app activities in android

As far as I know, there is no way to control over the activities occurring in an app in android phones unless the application that you want to log/monitor is written by you.
I wonder is it really like that or is there any possible way to do this? For example, is it possible to control over emails which, let's say, who I sent an email to in an android phone?
It is not possible to "just log it". Some events are possible to catch in broadcast receivers in a logging application. The user will get notified by particular event sniffing when installing such an application, by approving the permissions request.
It's generally possible to add instrumentation for security purposes to apps where they interface to the sdk api's, either by modifying the platform (rooted phone) or by decompiling, modifying, and recompiling the app using apktool.
possible of course does not mean trivially easy.

Categories

Resources