Screen rotation issue. Screen unable to come to its original view - android

I have original screen view as:
When i press '7' key on right hand side of keboard, view becomes:
When i wanted it in my original view as shown in first image, i press '9' button of keyboard and it becomes:
What can i do to have it in my original view as shown in first image?
Please help me.

It will be come in regular position u just relaunched the emulator. ya as per om sai said u also try by pressing "7" key

Try this
By again pressing to 7 key .. you will get grid in original position

The Problem is with not pressing "7" key again.. So just pressing "7" key again and get your solution.

Try this By again pressing to 7 key .. you will get grid in original position of your screen

If you run the application in emulator, you have a chance to face this issue. Pressing 7 will help you to bring back to original position.
If you run this on device you wont get this problem.Try running it on device

This is Emulator problem,Some time it happens due to system problem but here is not a concept of code because you have not written any code for landscape or portraits mode in your app.
So get this correct by:
pressing a 7 button once more
Or Restart your emulator

Related

Simulate keyStrokes from Android SoftKeyboard for Mobile Testing(Appium+Java)

Input action should happen like thisMobile Automation: I have a a scenario where i have to send keystrokes(inputs) from SoftKeyboard of an android device (like inputs from a real User). I tried with KeyEvent, SendKeys, androidkeycode, adb Shell input, Keys. Everything works fine, but i do not see any character pressed from a soft keyboard. Pls, help me to get solution for this.!!
The need: You need to simulate a press on the on-screen keyboard (using driver.tap())
The problem: Cannot get the Xpath or ID's of a on screen keyboard which puts us in a difficult situation.
Since i've struggled with this same problem in the past, i will advise you to create a function that calculate where each Key is located and press on it using the coordinates.
To be more clear:
Get the coordinates of lowest element you can find -> the keyboard itself is below it -> we can now know the height of the keyboard.
get the width of the screen
now, lets say you have a total of 4 rows(first row is q,w,e..) so we will divide the height by 4.
lets say you want a key from the first row which has 10 keys total, now dived the screen width by 10.
now you need to map each key to its location in a row. After that, call this function for each key you want to press.
I understand that it's ugly, and you will struggle with it a bit, but I don't know another solution to your problem.

Android studio - the emulator is stacked outside of the screen [duplicate]

This question already has answers here:
The Android emulator is out of view, how can I move it?
(11 answers)
Closed 7 years ago.
My android emulator won't show the minimize or close button, It's stuck to the left of my screen and I can't drag it to the right or anywhere.
have you tried moving it with the keyboard?
if you're using Windows -
Press ALT+SPACE+M together. You are now in Move mode. You might have to use the arrows UP, DOWN, LEFT, RIGHT to move your window.
press Enter to exit Move mode.
Press ALT + SPACE + M and move the windows by press UP, DOWN, LEFT, RIGHT and it will work.
Have fun ;)
Press ALT+spacebar then release and press m to get into Move mode. Use the arrow keys to move the window. Press Enter to exit Move mode.
sleepless is correct and it worked for me.
I have Windows 8.1
go to your users folder.
go to /.android
go to /avd
go to /[emulator].avd
edit emulator-user.ini
change the y to 10 or more and save.
To resize the emulator while running:
go to Control Panel
Click on Programs
Click on Turn Windows features on or off
check Telnet Client and Telnet Server. hit 'OK'
Run -> cmd
type 'cd\'
type 'telnet localhost 5554'
type 'help' to get a list of commands
type 'window scale .3' or .2 or whatever size you want and close
Thanks to E Angkor
No above option work for me.But while i trying that my whole scree orient portail in windows 7.When i switch it back emulator automatically orient correctly.Actually short cut rotate screen in window is ALT + CTRL + ARROW KEYS in my system.
There are two approaches:
1. remove the emulator-user.ini file under the .avd/ folder or the
$HOME/.android/ folder and try again;
2. change the values of x and y in the above file to be >= 10
ALT+spacebar and then "Agrandir pour remplir le bureau" in french "Zoom to fill the office" worked for me.

keyboard showing lately when i press edittext and also take time when i press the back button

When I edit text it takes some time to appear the keyboard, in my layout list view is there, without list view its coming quickly, with list view its taking time to appear. If I give give list view size manually it is working correctly.
thanks in advance guys
I tried with adjust span and all but still I am getting the same problem and also get the height of the keyboard and all but here also the same problem
You are testing your application on Emulator, Please run your project on Android Phone so the problem you are facing will not be there.

How do I turn edittext on and off?

I have an EditText field that has this
android:inputType="time"
I want to enable it with a button press (like change time) and disable it when done with another button press (like Enter). Someone suggested that you can disable an EditText field with
textView02.setInputType(null);
Which works, but I can't figure out how to get it back to having the default method enabled.
The other thing I tried, and it comes close to working is to turn off the field with this
textView02.setInputType(InputType.TYPE_NULL);
And turn it back on with this
textView02.setInputType(InputType.TYPE_DATETIME_VARIATION_TIME);
But I get the full keyboard requiring shifting to symbols to get the :
I thought I could use this
textView02.setInputType(InputType.TYPE_CLASS_DATETIME);
but I get unwanted characters / and - and worse than that it takes a long press on my phone to get the : instead of the /
PS. In a perfect world I would not need the enter function but instead rely on the done key on the pop-up keyboard. But I can live with a dedicated button.
Allen
textView02.setEnabled(false);
And to reenable, pass it true.
Every class extending View has the setEnabled(boolean) method.

Eclipse Display Window doesn't work I can't run anything there

Eclipse Display Window doesn't work I can't run anything there.
For example I am trying to do this in the Display view window:
System.out.println("test")
But nothing happens, and when I looked in Eclipse documentationa and in the internet I found that the j icon on the upper right corner of the Display window should be active after I highlight the line of code or I can right click after I highlight the code and see the option to execute the code. but nothing is working.
Please help.
Try highlighting the text that you typed into the display window. You might be able to execute it once you do that.
This is because Display is used only when the code is being debugged. Put a Breakpoint in the code and while the process stops there, use Display to execute your code. It must work.
I am assuming that Consol Window is not opened in your eclipse. Just follow this steps,
Go to Window Menu
Select Show View
Select Consol ( or shortcut key is Alt+Shift+ Q C )
Just select the command like:
System.out.println("test")
and press Ctrl+U or right click on highlighted text and select execute. It will work.

Categories

Resources