What hovering means on button in Android? - java

I know that we can catch Hovering event in Android. So, I added a Button in my layout files.
What does Hovering mean in Android ?
Press button and lifting finder from it?
Put your finger on button (Impossible in Android). We can do it by connecting mouse through OTP cable. But why would a developer implement it?

Also, on Android TV, it makes a lot of sense to Hover over an element, especially if it is supporting mouse pointer movement using TV remote

There are devices which supports 'Air Gesture' and hovering can be used for that. Check this:
https://play.google.com/store/apps/details?id=com.golgorz.hoveringcontrols&hl=en

IN some of the popular smart phone there is a way to dismiss call by just hovering the hand over the screen.
We can do it by connecting mouse through OTP cable. But why would a developer implement it?
The popularity of android id not limited to mobile devices alone there is TV,auto, variables etc. so with most of the tv you have universal remote which come with trackball also this is also used there .

Related

Android Studio - AVD doesn't recognize gestures (cant unlock emulator)

I just started learning to program for android and sadly after making one program (Hello World) I have already ran into an issue. The gesture for "Swipe to Unlock" or for the camera are not functioning. I can bypass it on the stock emulator because it shows a notification i can click that will skip the screen, however i would much rather just figure out a solution, i have searched around on Google and StackOverflow to no avail... maybe someone can help out.
Thanks in advance,
Jon
ok solved! for those that might have the same problem, just press f2
adb shell input keyevent 82
I had the same issue and grew tired of it, this always worked.
AVD_WXGA_TABLET emulator.
Android v 7
F2 does nothing.
Dragging with left-down mouse tries to do a swipe up but bounces back down when I release the mouse.
I've tried fast and slow, release on the virtual device or off it. Short and long strokes. You name it...
The f'ing thing won't unlock. And for all the keystrokes available in the tool pallet including fingerprints, there is no simple swipe-left/up/down/right. You'd think they would have had cntrol-alt-arrow for that out of sheer common sense or as the result of the developer trying to use it.
In my case, I just restarted the simulator by holding down the "Power" button in the simulator menu for a couple of seconds and then choosing "Restart." I was able to unlock the simulator easily after that.
I'm not sure exactly which step solved it, maybe all, but these were my steps
Use the SDK manager to update to the latest version of the emulator
Turn off the emulator (hold the power button and select Power Off)
Close Android Studio
Reopen Android Studio
Launch the emulator from the AVD manager
On mac you can keep holding the command key and then do the swipe gesture with the mouse or trackpad of your computer.
Video
Try using one of two ways
Swipe up from top section of screen
Swipe up from bottom section of screen i.e. just above the navigation buttons.

Libgdx getting mouse position in android

I have a game that's running on ouya. I want to make a game object follow the cursor, but mouseMoved() only gets called in the desktop version of libgdx. Similarly, Gdx.input.getX() and getY() only update when the mouse is clicked (ouya touchpad tapped).
badlogic recommends using their controller api over the official ouya one for various reasons, and it works perfectly with everything else. Is there a way for libgdx to return the cursor position in android? I really want to avoid rewriting all my other controls when the libgdx controller extension works in every other aspect and supports multiple controllers.
Thanks.
You might want to try a non-OUYA approach. I can plug a USB mouse and keyboard into my phone using a USB adapter and I can pair a bluetooth mouse with my phone too. In fact you have to do this with a lot those HDMI android pc on a stick things. A mouse should cause all the touch events you normally detect in LibGDX but I think the OUYA touchpad functions a mouse so if you want to track it like a regular mouse you should be able to.
If you look at how the Android backend and PC backend are implemented you'll see that getX and similar query the mouse on PC but return the last stored touch location on android. But starting in Honeycomb you can get the cursor position with View.OnGenericMotionListener (see Android: Tracking mouse pointer movement).
So you can add in some android specific (but not OUYA specific) code to track the cursor position.
Oh, and Android 4 added even more mouse related support - https://developer.android.com/about/versions/android-4.0.html
I know it's been a while and you probably figured out how to do it, but I just wanted to let you know that I've submitted a patch to libGDX that allows for mouse tracking in the same way you do it on the desktop.
It's now done natively, starting with libGDX 1.4.1

The Android "back" button

I am an Apple iPhone user. I have never owned an Android of any type so I am used to the button I have to tap on the screen to go back a screen instead of the physical "back button" that Android has. An iPhone developer has to code the back button in for the user to operate the game but an Android developer does not necessarily have to code a back button and can just rely on the physical button on the phone.
My question is if it is okay for me not to code a button for my Android app and just let the user use the hardware back button on their phone? If there is no back button to tap, will an Android user instinctively know to hit the physical back button to jump back a screen? I don't really know this answer since I have never owned an Android and always rely on the iPhone coded in buttons.
The picture below is me coding in the back button instead of relying on the physical button on the phone. I am wanting to back out the back button from my code.
You shouldn't code a back button on your app. See the pure android guidelines here for more info on android apps look and feel.
Every Android Device contains Back Button. And Android users using the Back button since first version of android released. They All have idea on Back button , No need to implement it separately, User already Habituated it.
I have developed for both iOS and Android, and find the best answer to be using both. Android users know to use the hardware back button, but new users, or former iPhone users, often expect an on-screen button. There is no harm in having both, and an on-screen button may be a nice visual touch.
Cases where you may decide not to have a back button include layout for smaller screens - when screen real-estate is very precious. Just keep in mind that the most important part of an application is the user experience.
The key is to make your app as user friendly to all users - but don't take away the expected experience from dedicated Android users (for instance, if you are developing a single-activity app with multiple popup Views, the ideal performance of the back button will close the view, rather than closing the whole app).
Also if you want to have a button to go back at the top right of the activity, there is a way to add one on the action bar. Take a look at the Android Developers page if you want.

Does Android have an Internet status turning circle in the top bar like the iPhone has?

The iPhone has this swirling icon, which you can make appear when the Internet is working behind in the background. It's a VERY simple call to turn it on/off.
Does Android have anything like this? How do I call it and how does it work?
You should display this in the ActionBar.
The simplest way
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
Or using ActionBarSherlock for backwards compatibility
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setSupportProgressBarIndeterminateVisibility(true);
No, i haven't seen it on android yet. However with ICS and above, we see 2 arrows accompanying the WiFi or 3G to indicate if there is activity on the network. However it may not be possible to programmatically control it.
You could otherwise use a indeterminate progress bar within your activity to show background work.
You could try using Android Notifications and use an AnimationDrawable. Check this answer. (Note that I haven't tried it).

Accessing hardware buttons within the camera app

i wish to write a plugin that will enable me to access hardware buttons of the phone while using the camera app. how would i go about doing this. or is it even possible.
Sorry, you can't generally do this. There are some keys that applications can respond to while in the background (specifically the media play/pause/etc buttons) but it is not generally possible to process key events while another app has focus.
Your best best is to check the Camera source but you might consider making your own app based on Camera.

Categories

Resources