Stereo (3D) rendering on Android Smartphones with OpenGL? How? - android

Seeing as there are smartphones with 3D displayes coming out on the market I was wondering if it was possible to render in stereo using the Android 4.0 SDK. On a desktop I'd basically do the following:
glDrawBuffer(GL_BACK_LEFT);
//Draw image for left eye.
glDrawBuffer(GL_BACK_RIGHT);
//Right eye.
So far I couldn't find out how to do this with the Android SDK. Is there any related call with a different naming or does this simply not exist in the official SDK yet? If it doesn't, is there any other Android/OpenGLES SDK out there that allows to do this?
Thanks and cheers.

Unfortunately, I don't think there's a unified way of doing this. Each manufacturer has their own specific implementation. As far as I know it's all high level stuff, so probably not what you're looking for.
For HTC, it's in the OpenSense SDK:
http://htcdev.com/devcenter/opensense-sdk
For LG, there's a package in the Android SDK Manager called "Real3D by LGE". It's API level 10.

Related

How to access the 2nd screen in a dual screen Android phone with Xamarin

I'm starting to work on a project where we need to access the 2nd screen of a dual screen phone, we are using Xamarin. I cannot find any documentation on how to do this. Is anyone aware of a way to do this?
The above comments are focused on second external screens, which is mostly what was around in 2019 :)
Now there are multiple dual-screen devices, including the Microsoft Surface Duo, and a couple of different styles from Samsung (Galaxy Fold/2, Galaxy Flip).
If you're using Xamarin.Forms, there's a TwoPaneView layout control that specifically detects and adapts to dual-screens, and also a DualScreenInfo helper class for device metrics. Get started docs and more details are available on learn.microsoft.com. Check out these samples and this GitHub repo. These APIs are currently hardcoded for the Surface Duo device.
If you're using Xamarin.Android, you have two options:
Microsoft's DisplayMask API, which is surfaced in the Xamarin.DuoSDK NuGet package. This is also targeted just at the Surface Duo - the GitHub repo has Xamarin.Android samples showing how it works.
The binding for Android's Jetpack Window Manager, in Xamarin.AndroidX.Window NuGet package (currently in alpha). This is the 'generic' API that will work on folding devices from multiple OEMs (eg. Samsung). Because it's still in alpha (as of April 2021), there aren't a lot of samples around but better support is coming.

Android TSP Hovering

Is there any way (or any API) that we can use to check if TSP Hovering is supported by android devices?
There are listeners added in android API 14 i.e. View.OnHoverListener. But this does not show if Finger Hover is supported.
Here is link which describes Samsung doesn't provide any such API.
I want generalized solution using Android APIs.
Does anyone have any idea about this or any hack ?

Camera preview shows unwanted tiles only on Android 4.2.2 (S4, full HD screen)

My app runs with many devices but 2 users have send me simular images as below.
As far as I know the behaviour is only seen on Android 4.2.2 (Samsung S4).
On the full HD screen there seem to be 3 compressed tiles of 160x600 pixels.
I have tried an AVD with full HD screen but that fails to start.
On 4.03 devices I don't see this. I don't use tiles.
Does anybody have a hint what or where this goes wrong ?
This looks like a possible bug in the Android platform on Samsung's S4 devices with that particular Android version. My experience tells me that it's a very real possibility. It could also be that you do something wrong in your app that only causes actual problems on that version (and maybe even only on that device), but there is no indication of that from what you tell. Android 4.2.2 should be backwards compatible with 4.0.3, so in general it should work on the later version too, of course.
I would advice you (or anyone in the same situation) to try it out on other devices with the same Android version if possible. Also, double check that you're not violating anything in the Android API documentation.
Please add more info about what you're doing and how if you need more detailed answers. I guess you've probably found a solution or workaround by now, but still adding my answer here.

Creating Android UI like HTC Sense

Do you have any idea what's the starting point to develop an UI for Android OS, similar with HTC SenseUI ?
Can I create that on top of Android or I need to get the Android source code ?
Thank you.
Florin Matincă
You'd need to modify the Android OS to some extent, but since Android is open source, that's not a problem.
The problem is getting it installed on phones - if you've noticed, the only companies that have custom UIs are also phone manufacturers, so they can just ship their phones with it installed. Also, if a new version of Android comes out, you'd need to get the new source, and modify most of it again.
Distribution would be a serious problem...
HTC Sense consist of a variety of functions.
Some like the Lock Screen can be implemented as normal programs. The start screen for programs can as well.
The systems setting for example can't be easily replaced without going into the android source code.
I have to disagree with xil3, there are some realy popular home screen replacements out there not restricted to a certain brand.
ADW.Launcher
LauncherPro
HelixLauncher
HelixLauncher2
All four are available on market place and therefor the distribution is simple.
HelixLauncher (and 2) are based on the Launcher from android itself, for which the sources are available as a git repository. This means you could use these sources to start your own Home Screen replacement.
So have fun!

Want to develop for Android. Have a few basic, non-FAQ questions

Recently myself and a small group of friends became interested in developing a game for a mobile platform. Originally we considered the iPhone but none of us use macs, so we decided Android would be a more realistic platform to use. Before we get started, I was hoping that I might find some answers to a couple questions so we don't waste our time if this project isn't feasible. Any help is appreciated!
I can't seem to find out how many programming languages Android supports. Java is obvious, but what about C+? It seems that Android supports C and C++ through Eclipse, but is that it? (I'm not the programmer for the project which is why I'm asking this. He's comfortable in C+).
Our game involves the use of two digital analog sticks (it's not a twin-stick shooter but it's a similar concept). It would seem that most Droid devices unfortunately don't use multi-touch though... Are there many devices out there right now which support this functionality and I'm just not seeing them, or should we possibly consider the development of a different game that would only use a single input?
Assuming there's no snags following those first two questions, what would you consider the best screen resolution to develop in? It seems like there are a variety of resolutions out there right now and we can't decide which is the best to use.
Again, any answers are appreciated!
You will have to use at least some Java, though you can call C++ with the newly released NDK.
To my knowledge at least the Droid and Nexus One support multitouch. Not sure about the newer ones.
I would develop for multiple screen sizes.
Chris Pruett did two very good presentations on writing real time games for android you may want to look into, they were a huge help for me.He also lightly touches on the NDK in the second one, linked below. I can only post one link since I'm a new member, but a google search for "writing real-time games for android" should turn it up.
http://bit.ly/checYY
1) Java is the language of the SDK. The majority of apps are and should be written in Java. The only reason for the NDK is for apps previously written in C++ that are to be ported to Android. There are downsides - it only supports compiling to 2 different CPUs (one is the Nexus one's CPU, can't remember what the other is). So if you do use C/C++ in the NDK, you are seriously limiting the number of devices you can ship to.
2) If you want to use dual analog sticks, why not display the sticks in the corners of the screen and allow the user to place their thumbs on them? You don't need hardware support.
3) Android SDK supports multiple screen resolutions so you don't necessarily need to worry about it immediately. I would aim for WVGA to start with (800x480 - Nexus One / HTC Desire).
Your first question has been answered by others already. The SDK is based on Dalvik, you're going to have to speak Java to the Android framework to do things like set up your activity, handle events, etc. You can call into a native code module built with the NDK for other things.
The multitouch situation on Android is dependent on hardware. Android >= 2.0 supports it in the framework, and you can use the PackageManager to query for what kind of multitouch functionality the device supports. The two you care about are FEATURE_TOUCHSCREEN_MULTITOUCH and FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT. Some screens that only offer FEATURE_TOUCHSCREEN_MULTITOUCH have problems distinguishing precise movement when both fingers are along or near the same X or Y coordinate. This is fine for things like zoom gestures, but you might have problems doing dual-analog style controls on a device without FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT.
Plan on supporting multiple resolutions. If you provide low and high resolution assets the resource system can select the appropriate ones for you automatically at runtime. More details on this here. You will still need to deal with different resolutions that do not necessarily share an aspect ratio. For example, the Droid is 480x854 while the Nexus One is 480x800.

Categories

Resources