Using UiAutomator on drop down list - android

I'm exploring the UiAutomator capabilities on Android and I am trying to test it out along with the Google hangouts app. I've managed to go to the create new hangout page and enter a name, but I can't click on any of the drop down contacts as shown in the image below. I've tried searching by the package name com.google.android.talk and then using the instance() function, but I wasn't able to select the contacts. Is there anyway I could figure what the class name of that UI element would be? Or how else could I go about clicking that ui element?

You could try this tool:
/home/gabriel/android/android-sdk/tools/uiautomatorviewer
Use it to navigate through the application's views and layouts.

Related

Is it possible for a Flutter for Android activity to NOT be fullscreen? Or have no UI at all?

I'm building a somewhat basic app (only testing on Android for now) with multiple lists, one of which is an Inbox list. I can share text from other apps to my app, and it works well.
However, I would like the app to handle the intent without launching the full app UI. For example, if I share a URL from the browser to my app, I would like it to be handled in the background, save the URL to Firestore, and show a toast to the user indicating that it was successful.
Ideally, I would like to put two entries in the share menu, one to add to the Inbox and show a toast as described above, and a second entry that gives the user a modal dialog that floats above the sharing-from app, which allows the user to choose a different list to save to.
I think I'll have to make a (for example) ShareActivity.java, and add it to AndroidManifest.xml, but I have no idea where to go after that, or even if that's the right approach.

Verify if clicking something get you out of the app in appium

I would like to know if it's possible to test that if I click on a element in my app (android or ios) it opens another app over mine
For example
If I click on a publicity does it goes out of the application and open a browser or not
If I click on a button to open another app does it goes correctly to the other one or to the store or not
etc
Yeah ! You can verify both points. Use String getCurrentActivity=driver.currentActivity(); if you know your second apps activities then directly verify activity against current one.
In general yes it is possible. Simply using Appium's inspector go throught your scenario:
If I click on a publicity does it goes out of the application and open a browser or not
And then check if Inspector found particular elements that you can base on in your tests - check if those web view has some id's, name or xpath.
pick an id from your app, after exiting your app check that id , if its present your in your app still, if its not present ,you have exited your app

Non navigational options SideBar

Hi i was wondering if it was possible to create a Sidebar for an activity that would allow a user to select a few options such as extra information that can be associated with an object. before sending it off to a server through an API I have looked at trying to use Googles own Nav bar as well as a few Third party libraries that dont seem to want to work for me.
Encase you dont understand what im trying to achieve ill give an example:
Say i have an activity that allows the user to create a log for a specific group within the app now the user may press submit and it will be sent off to the server to be stored in a Database but the user can also associate other aspects to this log such as a book id or an activity ID.
So the user should able to pull a side bar from the side and select any extra information they need (probably from spinners or extendable listview) and then go back to the main activity and submit the log.
Is there anyway of creating anything like what im asking with out having to dig into third party libraries?
You can define arbitrary layout for your NavDrawer (I will use the name of android component here). There is no enforcement to navigation here. So, put in NavDrawer's layout a bunch of controls that you need and define their onClick, onSelected, etc. methods to handle corresponding properties changing. On submitting just get checked/selected/entered info from controls in NavDrawer, augment your data with it and send to server.

View / Edit Contact on Android

I am trying to add these functionality in my Android app:
1) Get A list of suggested contacts from a Web Service and Display them in a list view
- This I have implemented and working fine
2) When User selects any of these contacts I want to present them in Native Contact View. My fried who is iPhone developer was able to do this with help of ABPerson class which provides feature to display the contact in native contact view page without adding the contact to contact list. I am not able to find any such API in Andoid. Please suggest.
3) When User want to edit any contact in the above list, I am able to present Edit Contact activity from native Phone Book app. This is working fine, but I am not able to remove the Done and Revert button. Unfortunately due to this, if user click on Done that contact is added to phone, however, what I want to do here is that, user can modify the data and I will keep it in the memory till the export process starts. During the export process I will insert these records in the Phone Book.
Please suggest me how can I do this.
I would advise you look over the BusinessCard sample and ContactManager sample posted on the Android developer site.
Reading carefully through both of these is what helped me understand exactly what's going on in the contacts API.

Android ListView

I would like to create a custom list view like in the Native Email application
When you click the check box you can add a click listner and do a particular action
When you long press it opens the contextual Menu
When you click the list item it performs another function like going to another activity to display that email kind.
If you can point to the code in the Native Email Application.. it would be great too :)
If it is sufficient to post a link to the app you need, here's a link to the source of Email Application.
Other resources you should check out:
Hello Views tutorial
API Demos in the samples folder of Android SDK

Categories

Resources