Is the Samsung S-pen input the same as your fingers? - android

I have no actual Galaxy Note on-hand and no access to such device so
I would like to ask if the S-Pen behaves the same way as a Finger on a SurfaceView?
Basing from the behavior of S-Pen SDK samples when run on an emulator, it seems that the S-Pen's input is the same with finger inputs only that it is very precise. (noticing that when run on the emulator, its impossible to detect if input came from a finger or S-Pen since touch input is emulated via the mouse cursor)
I'd like to confirm if the gestures I can do with my finger is also doable using the S-Pen?
If this is the case, is it safe to say that the S-Pen is comparable to a very thin finger?
The only difference it can make, is that when an app is coded with specific functionality using the SDK that samsung provides?
Thanks

As it will be easier for everyone to spot an answer and not a comment, here's an explanation from samsung developers themselves:
S Pen behavior on SurfaceView - http://developer.samsung.com/

Yes, using the international Samsung Note (still waiting on ICS). But your question would be better served by one of the xda developers forums.
Using the S Memo app to add a memo, selecting the pen input option, I can write a note using my finger. The stroke is thin, as it would be for a pen...
I can use the pen to interact with anything on the screen, as if it were my finger. But the pen can not interact with the capacitative buttons, nevermind the physical ones.

The s pen works with the Wacom digitizer in the Note devices. This allows for precision, pressure sensitivity (256 levels on my Note II), and hover events. These are pointer events, not touch or mouse/click events at the OS level.

Related

How to hide system mouse cursor? (bluetooth or OTG connect)

I am working on a game app. Like all game apps, it renders two side-by-side views. I would like to support using a bluetooth or OTG mouse in my app. So, I need to hide the normal mouse pointer.
I have done a bit of searching, but can not seem to figure out how to do this. I did find something that says Android 7.0 is getting a new API for custom pointers:
http://www.androidpolice.com/2016/06/16/android-n-gets-support-custom-mouse-pointers-via-new-api-dev-preview-4/
That's great, and would probably allow me to make a blank custom pointer.
But I need this to work on my current hardware with Android 6. And I know it's possible, because the other device does hide the mouse pointer.
Any tips or tricks to achieve this would be most welcome.

Touch not working on android apps running on ARC

I have a laptop running windows 8.1 with a touch enabled screen.
I am using arc to run apk on the laptop.
The touch works fine on ARC welder but after launching apk, the touch event does not work on app's screen. Just the mouse event works.
I have tried multiple apks and everyone behaves same.
Do we have to enable something to make the touch events work?
This is a bug that has been reported here:
https://code.google.com/p/chromium/issues/detail?id=480745
So a way of getting around this at least for map applications is to specifically code the APK to handle the event and you must use the Arc-Metadata tag of
"enableSynthesizeTouchEventsOnWheel": false, this stops the runtime from trying to interpret your scroll wheel as a touch instead of the SOURCE_CLASS it is.
So for the input device SOURCE_CLASS_POINTER, you have to define ACTION_SCROLL so that a mouse scroll wheel will allow you to do actions. There is plenty of examples of how to do this all over StackOverflow though, just disable that meta-tag and most of the code you normally use for making things work in Android will work here.
Note: Haven't tried "enableSynthesizeTouchEventsOnClick": false, and testing with SOURCE_ that equals a external touchscreen but i believe it would work .

Disabling android navigation buttons for disabled children

We’re porting to Android some interactive iOS apps used to teach young children with learning disabilities. We have hit a major usability issue, because we can't figure out how to disable physical or on-screen navigation buttons (Home and Recent Apps).
Before anyone says “you don’t want to do that”, we fully understand why you would always want these buttons enabled for an able-bodied adult, but these children pose a unique set of accessibility issues. Specifically:
Their fine motor control may be poor - they may inadvertently touch a different area of the screen to the area they intend, or accidentally use more than one finger at once.
They may have weak muscle tone and poor physical strength – so e.g. the bottom of the palm of their hand may drop and touch the screen while trying to just use a finger.
They struggle to achieve and easily become disheartened or disruptive if they fail.
For instance, a typical 5 year old child with Down syndrome will accidentally drop out of the app they are using as a result of inadvertently touching the Home button: when this happens repeatedly, and the adult teacher or parent has to go back into the app for them repeatedly, the child loses interest and focus. Another typical scenario is a young child with Autism, who may freak out completely and need physically restraining if this happens while using their favourite app. Also, many disabled children will try to poke any other button they can find, in search of a response. In any of these situations, a potentially valuable educational session may have to be completely abandoned.
We're aware of SYSTEM_UI_FLAG_HIDE_NAVIGATION and SYSTEM_UI_FLAG_LOW_PROFILE, but these only reduce the visibility of the on-screen buttons until the child touches some other part of the screen, and then they re-appear in a way that’s more distracting than if they were visible all the time.
On iOS there is the “Guided Access” feature that solves this problem trivially. Can we emulate anything similar on Android?
On iOS there is the “Guided Access” feature that solves this problem trivially.
Guided access appears to be a device setting, not something that developers enable unilaterally themselves, thank heavens.
Can we emulate anything similar on Android?
There is no similar device setting in stock Android.
You can download the Android source code, modify it as you see fit, build the results into a ROM mod, and install that ROM mod on devices as you see fit.
Or, you can perhaps work with a device manufacturer creating tablets aimed at children to see if either they have already added this capability to their devices, or would be willing to work with you to add such a capability in a future iteration of their devices.

Android: enumerating the buttons on a gamepad

I have an Android device into which a gamepad can be connected (it's a totally standard XBox 360 controller, but I need to support other varieties as well). The gamepad is showing up as a InputDevice with some analogue axes and some buttons.
I need to be able to query Android to find out what buttons the gamepad supports. Does anyone know how to do this?
I know that the system has this information, because if I write a command-line app which opens /dev/input/event... and queries the buttons using the EVIOCGBIT ioctl, I get a nice list of supported buttons from the kernel. But I can't do this from an Android application because I don't have permission to access the input devices directly.
It looks like it should be possible to get the InputDevice's KeyCharacterMap object and query that; but it looks like Android has attached the default QWERTY keyboard keymap to the gamepad, rather than constructing one that actually matches what the gamepad supports. This will happily tell me that the gamepad has a Q key, which it doesn't, and that it doesn't have a BUTTON_X key, which it does, and for which I am receiving key events. So that's not helping.
Is there any way to do this?
I haven't figured out a way yet, but I have found a horrible workaround.
If you call KeyCharacterMap.deviceHasKey(keycode), I can ask Android if any input device on the system supports the specified keycode. By iterating through all possible buttons that can occur on a gamepad (usefully, they're all called KeyEvent.KEYCODE_BUTTON_something), I can figure out that any connected gamepad must support at least some of these buttons.
It's not a very nice solution --- if I have an XBox 360 controller and a Wiimote connected at the same time, then I can't figure out that the XBox controller does not have buttons 1 or 2, and the Wiimote does not have X or Y, for example. But at least it's a start.
If anyone has any better ideas, please suggest some...

Reacting to multi-buttons wired headphones

I am driving some experiments with a pair of a-JAYS Four headphones (having 3 buttons on its wired remote/mic) plugged onto a Galaxy Nexus (ICS 4.0.2).
My issue is that only the middle button is 'recognised' by a test app I have written, i.e. triggering both Intent.ACTION_MEDIA_BUTTON and/or Activity.onKeyDown callback with KeyCode 79 when it is pressed.
Pressing the two other buttons don't trigger any of the previous methods. For info, those headphones and its 3 buttons work on Apple iPhones and Apple computers (at least a MacBookPro 2011), as advertised on the box...
Firstly I thought Android or my device could simply not handle more than one button on a wired jack remote (even if that sounds weird...) but then I had a try with a pair of headphones from HTC (the ones coming with one of their Desire device) having 3 buttons. Middle button would react the same way as my a-JAYS, but the two other buttons are also recognised with KeyCodes 87 and 88, respectively Play Previous and Play Next media keys.
So it seems that either the device or the low levels layers of Android are simply not able to catch certain headphones buttons signals :/ (at least those which are not 87 and 88)
Any idea anyone about how to make Android able to recognise other buttons/signals from such headphones as Apple compatible ones? Would it imply low levels drivers writing for ICS or am I missing something really obvious?
Any help would be much appreciated. Can post my test-app code if needed.
Cheers
The signals/ resistance from the volume control buttons (1.525-1.495 V for volume down, and 1.619-1.587 V for volume up) are currently unable to be recognized through the android framework's software. I believe this has to do with Apple having a patent on the designated volume controls and so Google won't release to developers how the framework recognizes particular signals through the fourth connector on the headphone jack. The center/mic/action buttons on headsets generally work, it shorts the path from ~2V to ~0V and Apple does not own the patent for that. If someone could figure out how to interact with the inputs on their own that would be huge. I am tempted to learn app development and find a workaround.
The problem is more complicated that it seems: http://david.carne.ca/shuffle_hax/shuffle_remote.html .
I have to emphasize that I am no expert on this topic, but from what I have read and tried so far I conclude that it is not impossible to have an Android phone respond to an iPhone headphone's volume buttons, but for some reason the performance is poor/lagging.
There are some apps trying to do the magic, but they are too unreliable for everyday use. I suppose the problem is that triggering the signal may have to be implemented at a lower OS level than most regular apps have access too.
The solution could probably be some kind of a ROM mod...
If you can implement this, I am sure it would be a big deal for the Android community, and maybe a good biz for you.
Kind Regards, your fellow Hungarian
Gergő
You have to press and hold the middle button while plugging the headphones to the jack. That will make the microphone work on an Android. It works on my HTC Thunderbolt.
I believe it's a hardware issue (at least in regards to Apple headphones). If you look at the plug on those they have four contacts instead of the normal three. I'm willing to bet they run their button signals through that extra contact. AFAIK, there is no Android equipment wth jacks to match that.
So, ultimately I don't believe you can make apple earphones with buttons work for android (as far as button functions go).
You have to hold the middle the whole time for it to work. If you let go and not playin music it says accsessary not supported but if u play music and let go it simply stops the music until you hold it again. Maybe tape the middle button shut really tight?
If you look at the four contacts, tip-ring-ring-sleeve (TRRS), and know that MOST headphone sets are:
tip: left
ring 1: right
ring 2: ground
sleeve: mic
(1/4 inch pro audio stereo plugs are known as TRS - tip-ring-sleeve)
although some reverse the ground and mic contacts, what you need to know as far as how the device recognizes the different buttons you have, is that those buttons are making a short between the ground and mic contacts.
(before IR, old school WIRED remotes for VCRs used resistance for different functions)
Now your homework to find out what is going on is:
measure the resistance between ring 2 and the sleeve for each one of your buttons
find out if it is a momentary short, or constant
if you have some other headphone/mic device that works correctly, measure those impedance (resistance) too
I don't know how into this you want to get, but you can buy resistors with the correct impedance to get the functions you want out of the Android device, the question is, do you know what functions the device is capable of, and what those impedances are that trigger that function.
daniel#destinypatrolsoftware.com

Categories

Resources