[Solved]Ogre19 SampleBrowser notworking correctly on Android

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
shikui
Gnoblar
Posts: 6
Joined: Sat May 24, 2014 9:59 am

[Solved]Ogre19 SampleBrowser notworking correctly on Android

Post by shikui »

Sample Browser works fine in 'portrait' orientation mode. However, when I add this line

Code: Select all

android:screenOrientation="landscape"
to AndroidManifest.xml, redeply the apk, strange thing happens Every first time the demo browser is created and launched, screen looks messed up, as the picture below shows. If I tap HOME key, return to main screen and then resume the app, the problem is gone and everything back to nornal.

The configuration:
Ogre verson newly checkout out from bitbucket with tag v1-9 .
NDK version: ndk-r8e-windows-x86
Device: android 4.3, screen resolution 1280x720, CPU Snapdragon MSM8926.

Has anyone encountered with the same problem? Is this a device specific issue? Thanks for your advice!
You do not have the required permissions to view the files attached to this post.
Last edited by shikui on Fri Jun 06, 2014 4:19 am, edited 1 time in total.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 139

Re: Ogre 1.9 Sample Browser not working correctly on Android

Post by c6burns »

By default the samplebrowser handles orientation changes so I'm not sure why it would matter which mode you launch in. Are you just testing if you can deploy landscape mode apps before writing up your own? Because you definitely can. Also I would not recommend the samplebrowser be the framework upon which you build your own app. Unless there is a specific reason you need a native activity, I think JNI is the way to go at this time (it's easier and you have access to some things that the NDK does not, though the NDK is rapidly improving). And even if you do go with a native activity, there is a lot going on in the sample framework that you will likely not need.
shikui
Gnoblar
Posts: 6
Joined: Sat May 24, 2014 9:59 am

Re: Ogre 1.9 Sample Browser not working correctly on Android

Post by shikui »

c6burns wrote:By default the samplebrowser handles orientation changes so I'm not sure why it would matter which mode you launch in. Are you just testing if you can deploy landscape mode apps before writing up your own? Because you definitely can. Also I would not recommend the samplebrowser be the framework upon which you build your own app. Unless there is a specific reason you need a native activity, I think JNI is the way to go at this time (it's easier and you have access to some things that the NDK does not, though the NDK is rapidly improving). And even if you do go with a native activity, there is a lot going on in the sample framework that you will likely not need.
It turns out that setting OGRE_NO_VIEWPORT_ORIENTATIONMODE flag to 1 seems to help and the problem is gone. Although I have no idea why.
In fact I am trying out gamekit and had the same problem as posted. Thanks for your reply and advice. And I agree with you that going fully native on android is a rather 'painful' approach, compared to 'great' Java programming experience under Android Studio/Eclipse.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 139

Re: Ogre 1.9 Sample Browser not working correctly on Android

Post by c6burns »

I think I may hate Java more than any other living soul, but I still have my apps crafted through JNI with a thin Java layer. A native activity is actually run via JNI anyway ... since the entire platform is Java after all there is no escaping it. Plus there are a lot of great interfaces that AFAIK are only available to Java (eg. gesture detection). Also OUYA did not have a native interface for their controllers last time I checked and OUYA support is pretty damn easy once you already have an apk built :)
Spekoda
Halfling
Posts: 40
Joined: Wed Jun 12, 2013 5:38 pm
Location: Finland
x 2

Re: Ogre 1.9 Sample Browser not working correctly on Android

Post by Spekoda »

shikui wrote:And I agree with you that going fully native on android is a rather 'painful' approach, compared to 'great' Java programming experience under Android Studio/Eclipse.
You can easily set up eclipse for native development. Just use the eclipse that comes with the android sdk (ADT already installed) and install C/C++ dev tools (CDT) to eclipse. Import the SampleBrowserNDK or start new project (you may need to run 'Add native support' from eclipse).
shikui
Gnoblar
Posts: 6
Joined: Sat May 24, 2014 9:59 am

Re: Ogre 1.9 Sample Browser not working correctly on Android

Post by shikui »

Spekoda wrote:You can easily set up eclipse for native development. Just use the eclipse that comes with the android sdk (ADT already installed) and install C/C++ dev tools (CDT) to eclipse. Import the SampleBrowserNDK or start new project (you may need to run 'Add native support' from eclipse).
Thanks for the tip.