Can I run stackblitz on my android phone? - android

I run stackblitz site on my android phone, and create an angular project. But when I want to create a new component, I don't see any place for typing the name of the component and therefore I can't create the component.
When I touch the "angular generator", then touch "component" choice, the keyboard appears but there isn't any place for typing the name of the component.
Screenshot from stackblitz on my android phon](https://i.stack.imgur.com/Rgyqa.jpg)

Related

Testing Android and iOS with a flutter embedded parts

What's the best way to test the following scenario?
Open native android app
Go to screen B written in flutter - click on button "OK"
Go to screen C which is a pure Android view again
Currently I use Appium but I can not find specific elements of B's screen because labels of button are not always available in inspector. In order to select button in tests i have to specify X and Y coordinates to push a click. I'm looking for a robust solution which will cover automated integration e2e test both for Android, iOS and flutter. Separate Flutter parts are tested in standalone mode using flutter integration test.
It turns out that Flutter in most of cases build an app with accessibility id visible in Appium. This accessibility id is derived from Widget text and other UI elements. Unfortunately I couldn't find any accessibility id for Icon widget. In order to to find such Widget in Appium you have to wrap it in flutter with Semantics widget.
Semantics(
label: "EDIT_PROFILE",
child: Icon(
After it's done you can easily find any widget in Appium.Answering main question: Appium is a good solution to test such scenarios where Flutter is only a embedded screen in Android app. I hope that test will go smoothly on iOS as well.

Espresso android automation tests - How to Access views of other application, opened by my application?

I have a button in my app, that when clicked - opens dropbox login page on chrome.
I'm trying to access the views in that opened chrome window to fill the fields and continue, but because that activity doesn't belong to my application, the views are not in the hierarchy tree.
Anyone knows how to access external application views with espresso?
I already tried with "UI-automator" and "espresso-web", but to no avail.
Android supports multiple windows. Normally, this is transparent (pun intended) to the users and the app developer, yet in certain cases multiple windows are visible (e.g. an auto-complete window gets drawn over the main application window in the search widget). To simplify your life, by default Espresso uses a heuristic to guess which Window you intend to interact with. This heuristic is almost always “good enough”; however, in rare cases, you’ll need to specify which window an interaction should target. You can do this by providing your own root window (aka Root) matcher: e.g. if you want to click on a pop-up which has "OK" and "Cancel" you can use Espresso like following.
onView(withText("OK")).inRoot(withDecorView(not(is(getActivity().getWindow().getDecorView())))).perform(click());
Another example is to use Espresso Intents: For example: User action that results in an external "phone" activity being launched as Clicked on the call button from your own app and you can verify using:
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
user.clickOnView(system.getView(R.id.callButton));
intended(toPackage("com.android.phone"));
Take a look at different examples mentioned on:
Official Google Android Test Forum

Using Hierarchy Viewer for Android App Widget

Is it possible to use Hierarchy Viewer for App Widget?
If yes, how? and is there any Tutorial for that?
Have you tried using Hierarchy Viewer for UI elemements? I followed these instructions yesterday and they worked fine for me.
To run Hierarchy Viewer, you can follow these steps:
Connect your device or launch an emulator.
To preserve security, Hierarchy Viewer can only connect to devices running a developer version of the Android system.
If you have not done so already, install the application you want to work with.
Run the application, and ensure that its UI is visible.
From a terminal (command prompt), launch hierarchyviewer from the /tools/ directory.
The first window you see displays a list of devices and emulators. To expand the list of Activity objects for a device or emulator, click the arrow on the left. This displays a list of the Activity objects whose UI is currently visible on the device or emulator. The objects are listed by their Android component name. The list includes both your application Activity and system Activity objects. A screenshot of this window appears in figure 1.
Select the name of your Activity from the list. You can now look at its view hierarchy using the View Hierarchy window, or look at a magnified image of the UI using the Pixel Perfect window.
Since this will not work on a stock Android system you must use either a developer version or an emulator.
Please! check here
Please let me know if these instructions don't work for app widgets or if you have more questions.
Now Hierarchy Viewer is deprecated, you should use Layout Inspector. I follow next steps:
launch my app with widget on emulator
click Tools/Layout Inspector
Set check box Show all processes
Next you should choose the process. Android app widget code executes
in OS launcher process, so you need choose it in Choose Process
menu. For me it calls com.android.launcher3
After all you get layout with your app widget
I think this steps don't work with real device, because system process doesn't available for debugging
This was the correct answer until Romain Guy developed a workaround.
You can now add the ViewServer class to your project, and use HierarchyView in any device.
The code needed is available here:
https://github.com/romainguy/ViewServer
For more info check this .

Block access to playstore in android?

I am trying to build a simple Parental Control App. I would like to know if it is possible to set the user to enter a password before he can install an app , either from the play store or
from running apk files.
Just pointing me in the right direction would be really helpful. Right now i am quiet clueless
on where to start.
Have you consider creating your own home screen launcher. Following post have some suggestion for creating your own launcher:
How can I create a custom home-screen replacement application for Android?
And following is one of the app that implement the parental contorl using the home launcher option:
https://play.google.com/store/apps/details?id=com.kiddoware.kidsplace&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5raWRkb3dhcmUua2lkc3BsYWNlIl0.

How do I run another Android application/activity in a window inside my app

What I want to do is be able to start another Android sub application (which I have not written myself) to run inside a window within my main application. I would want certain touch events etc on the elements of the main app that are still visible to allow me to stop the sub application.
I've found examples of how to launch another activity using an Intent - but I have found nothing allowing me to specify that it runs in a certain window.
Is this possible at all?
The window metaphor does not exist under normal Android.
Some tablet makers have added it to their builds, but using windows would reduce the portability of your app.

Categories

Resources