Tips and Tricks
Will advanced shader effects/normal mapping/real time shadows work on my android device?
- Qualcomm Snapdragon based devices (ex: Google/HTC Nexus One) –> yes
- Imagination Technologies Power SGX based devices (ex: Motorola Droid, Samsung Galaxy S) –> yes (just some weird things with shadows)
- Qualcomm MSM7xxx based devices (ex: HTC Hero) –> no (hardware too old)
- Other exotic low cost devices -> certainly no
Standard Hardware Keycodes:
- Back: 34
- Search: 255
- camera (HTC): 35
- menu: 115
Sony XPERIA play:
- left bumper: 122
- right bumper: 123
- arrows: left 33 right 32 up 30 down 31
- square: 119 circle 34 triangle 120 X 35
- select: 129
- start: 128
Setup: Game was designed in a landscape style while not doing any in-ShiVa kOptionViewportRotation. Changed the layout to landscape in the Android Manifest File.
In Eclipse, open your main Java File (src->YourApp.java). Go down to line ~832 (~1000) and look for ORIENTATION via search. Comment out the line that says setRequestedOrientation:
//oThis.setRequestedOrientation ( ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE ) ;
There is another one on line ~862 (~1030) for Portrait mode. Comment that out as well:
//oThis.setRequestedOrientation ( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ) ; // TODO: restore the original orientation
Official Tutorial on How to Sign an App: developer.android.com/tools/publishing/app-signing.html
My game is not showing up in the store
An application is visible in Android Market on a given device if this device matches the application minimum requirements. The OpenGL ES version is one of those requirements. The ShiVa engine is compatible with OpenGL ES 1.0, 1.1 and 2.0, but OpenGL ES 1.0 (without extensions) is so “old and unusable” that it is maintained only because it does not involve lot of work from us.
On Android, most devices with good hardware acceleration are compatible with at least OpenGL ES 1.1 (Google Nexus One, Motorola Droid, HTC Desire, etc.). So, we decided to only support phones that are at least OpenGL ES 1.1 capable, that’s why we put it as a requirement in the generated applications manifest.
The problem: More and more *recent* phones (including HTC Hero) are shipping with an old Qualcomm GPU (the MSM7XXXa) that only supports OpenGL ES 1.0, and to be honest we are currently working on trying to enable hardware rendering on those devices (but if we find a way to do it this chipset should be sufficient to make ShiVa applications work quite well, because it has the minimum extensions the engine needs in order to work). If the game is not visible on a given device, it’s just because *for now* it may not be compatible with it. By “not compatible” I mean it could work, but very slowly, and then be unusable (because using a software driver).
App rejected: WAKELOCK always keeps screen on
Open YourAppName.java in Eclipse and go to line 227 where it says “onEnableWakeLock ( true ) ;” and replace the true statement with the word false. Now the line should read:
onEnableWakeLock ( false ) ;
Open the ANT Build file on the left in the Package Explorer window called build.xml. Change line 2, depending on what kind of build you are targeting:
default="Build debug apk" default="Build release apk"
Save the build.xml file and drag it over to the ant build window. double click on the ant build that you just dragged inside of the ant window (Double click in the ant window side). If all goes well, your new apk file should be located in your workspace inside of the bin directory.
As many of you start programming over and over on various platforms, specifically iOS and Android/Eclipse, you will notice that you will be going back and forth between ShiVa and the ShiVa UAT and then back to either iOS or Eclipse for the final code. Now the issue comes up when you do all the work to get CUSTOM code, having to REDO all of those settings again for some simple changes in ShiVa for a bug you might have found. You can avoid that: After you export from ShiVa just rename your stk file to “S3DMain.smf” and replace your old smf in the project with this. No need to use the Authoring Tool during this process.