Simulate android shake - android

Is there an API method that can be used to simulate shaking an Android device? My reason for wanting to do this -
I had been experimenting with using HockeyApp to provide an in-app feedback facility for my beta testers. Whilst it works I find that in my hybrid Cordova app it displays an ugly feedback screen which
stays put till I hit the Back button
at which point it restarts the app - I suspect because it uses the WebView to display the feedback screen so in effect the app's own screen has to reload later
TestFairy provide a much sleeker UX when offering feedback and their "shake for feedback" concept is very nice. However, it may not be apparent to all my beta testers so I would like to provide a button which I can then use to simulate the shake gesture from the custom Cordova plugin that I am also writing for the app.

Related

PWA on Android - Pinned app: clicking back button makes app stop working

we developed a progressive web app with Angular. It is perfectly installable and executable on mobile devices.
Our requirement is that our customers can pin the PWA on their mobile Android tablets. That is, the user cannot exit the app until he or she enters the pin of the mobile device.
Problem
If the user clicks the back button too often (in browsers this would cause the browser to show the default page as configured), the pinned PWA just shows a blank screen with the app logo. From there on, the user has no chance to do anything. In the end, our customer has to enter the pin and restart the app.
Is there any possibility to change this behavior as this is not happening with native android apps. We also tested the web.dev PWA which has the same behavior, so its not just a problem of our code.
Best regards and thank you in advance.
Eep, that is most certainly a bug in Chrome and Android. I've filed a bug 1174604 with the team and will ask someone to look into it. I'd suggest staring the bug so that you get updates as it gets fixed.

How to track touch actions on screen during test automation with Appium

I am using appium to run automated tests for a mobile app. the app is on both android and ios and my tests are written in ruby.
In my test code, I tap specific coordinates on the screen however I am not able to verify that the correct position was tapped if no action resulted from the tap.
What I would like is some kinda of visual cue so that I can tell where on the screen was tapped, pressed, swiped, etc. Is there any way to do with appium?
On android, in the settings under developer options I can select "show taps" which will temporarily display a circle where I tap on the screen but this doesn't seem to work while running tests. I'd like to know if there are any ways to do this on either android or ios. Any help would be appreciated.
For Android you should enable Show touches and Pointer location too from developer option, It will show the pointer location of Click/Swipe/Tap. It's working fine for me during automation.

Is that possible to make timer (clock) quick access from lock screen? A calculator?

I moved from iPhone to Android (Samsung S7) and missing one feature. In iPhone I could use quick access to set clock and timer and set direct from locked screen if to press a button at quick access panel, shown at the picture with arrow. Is it possible to make a similar quick access to clock app in android from lock screen? To put it in android quick access panel or in some other way like third party app, etc: aiming to access clock app set on lock screen quick w/o logging in? Same question with Calculator app.
In Android you can do almost everything with apps.
I found here some apps that allow you to create widgets on your lockscreen, you click on them, unlock your screen, and the app launches:
https://www.maketecheasier.com/launch-apps-lockscreen-android/
I own a OnePlus so I know they have this option build in.
You can also use the Xposed module "GravityBox" or "LockscreenMods"
(it is not possible to bypass the unlockscreen through a lockscreen widget!)

Android: How to make device run only one app?

I have an customer project where I have to make single task android device. Customer isn't able to escape the application which my company have developed. Also customer isn't able to start any other application and our application is started when the device is booted. Overall all the customer is able to do with the device is run our application.
Is there any other way to make this work than rooting the device, disabling all system buttons and making our application the launcher. I have something like 400 devices for this purpose so rooting all those would cost lot of time.
I also read Google's tutorial about COSU devices but found it very confucing https://developer.android.com/work/cosu.html#testing-plan
Androids own screen pinning is not good enough because customer can escape the app. Some may suggest to use some kiosk application like SureLock but my company's goal is to find clear solution for this without using any third party apps. Also running our app via some kiosk application is not our goal.
I found some posts on the Stack Overflow with similar question, but not the answer I'm looking for.
If someone has some tips for this question I would be very grateful.
Single purpose devices built on top of Android can get difficult to implement. There are a few different options, but each have trade-offs.
As you mentioned, rooting devices will functionally get you what you want - however it will be time consuming with hundreds of devices to root, difficult to maintain, and you will (potentially) introduce security issues to your devices and app.
Another option is using Google's Lock Task Mode for COSU devices[1]. The link there has a nice graphic showing the features of lock task mode:
1 app pinned to the home screen
only apps white-listed by the DPC (device policy controller) can be locked
Home and Recent buttons hidden
exit by calling stopLockTask()
There are some downsides to using Google's solution for this. First Google recommends creating (and therefor maintaining) an entirely separate DPC app to run as a device owner and set policies[2]. You'll also be dependent on Google Play to manage application updates and be required to have Play accounts associated with each device which "are used to identify a single device that is not tied to a single user for simplified, per-device app distribution rules in COSU-style scenarios"[3]. To automatically get your DPC app on devices your "DPC must be publicly availble on Google Play, and the end user can install the DPC from the device setup wizard by entering the DPC-specific identifier."[3] You'll also need to upload the user application to Google Play[4], which may be an issue for some who don't want their apps on Play. Going this route gives you features you need, but can be complicated and also ties you and your customer pretty tightly with Google/Play services and their workflow.
You can also look at enterprise mobile deployment platforms like Mason[5]. In your case, you can create a custom Android OS in a few minutes with your app locked in kiosk mode (+ other features like disable camera/sms, remove apps and hide settings, etc.) and then deploy it to all of your devices remotely. Mason also supports OS and app updates controlled by you if your requirements change.
DISCLAIMER: I work for Mason
[1] https://developer.android.com/work/cosu.html
[2] https://developer.android.com/work/cosu.html#create-dpc
[3] https://developers.google.com/android/work/requirements/cosu
[4] https://developers.google.com/android/work/play/emm-api/samples#push_install_an_app_on_a_device
[5] https://bymason.com/
I went to the same problem before. I spent at least 3 days doing research. I tried to find many solutions but I found zero.
How I solve is
1. Up To JellyBean
- Use System Alert Dialog (And make it transparent and small size like 2 * 2 And display in some corner(User can't see it)). User can't press home button If there is system Alert dialog
2. After JellyBean, This method doesn't work. The user can press the home button even though there is System Alert Dialog.
so what I did is, start the service on stop and start the same activity again and again(within sec). So user can't see any difference.Don't forget to make activity as single task so that even though you start same activity from service, again and again, new activity will not create (So Ugly way )
- You can simple make screen full screen. make sure in kiosk mode try to check if the screen is in full-screen mode. if not make it full-screen mode(its not hard to do)
- other way is to make launcher app but when ever you pressed home button it always asked to choose launcher app. if user mistakenly choose default/ other launcher app, this solution doesnt work
Good luck
Make your application as a launcher application by defining in manifest file.
After that go to setting of your mobile device and change default launcher application to your application.

How to change the functionality of a key in android and symbian mobiles

I want to develop an application for blind using J2ME or Android. but i have few decision problems to make
1) Is it possible to change the functionality of a hard key in J2ME and Android
a) Totally like the home button can be changed to unlock the mobile like that
b) While program is running i.e An application is developed and during its usage the functionality can be modified.
2) Is it possible to add the audio feedback to the hard keys in J2ME or android
a) Totally like from the minute the mobile is switched on , whenever u press a button it will give its functionality in audio output.
b) While the program is running .i.e.An application is developed and during its usage the audio feedback can be added.
Please clear my doubts and help me in making decision
A touchscreen phone for blind people doesn't sound like a good idea to me :)
Android:
1 b) Without building your own custom rom no way to change the functionality of hard buttons globally. You are free to respond to buttons in your app as you like (except for the home button)
2 b) you can play any sounds while your app is running. But same problem here - you are resticted to inside your app.
Edit: Android has some features builtin:
http://eyes-free.googlecode.com/svn/trunk/documentation/android_access/index.html

Categories

Resources