Tuesday, January 27, 2009

Installing SGH-Z720 Java Applications or Games from PC

Credits

http://www.geppo.org/post.asp?id=124
http://www.geppo.org/post.asp?id=66

Instructions

1) download your .jar and .jad files e.g. FooBar.jar FooBar.jad to your PC
2) install the Samsung PC Studio application (e.g. http://www.samsungmobile.co.il/downLoadItem.aspx?file=Samsung_PC_Studio_312_GH1.exe&dir=DownloadsDirectory)
3) connect your phone to the PC with the USB data cable
4) open the PC Studio application and select Phone Explorer select your phone
5) right click create new folder
6) name that folder Game
7) create subfolders (as much applications as you have) e.g. FooBar
8) drag/drop or copy the files to the newly created folder(s)
9) rename the Game folder to Games with a space after the s i.e. "Games " (without the "")
10) the folder will disappear - its OK it should happen
1!) disconnect from the PC
12) enter secrete menu code to your phone *#6984125*#
13) select "4. Internals"
14) enter Master key *#9072641*#
15) select "7. Storage Settings"
16) select "2. Update Java DB" you will get popup messages "Updating..." "Updated"
17) go back to the main menu and select your application or game e.g. MyFiles > Games and More > FooBar

that is all, thanks to the guy from the credit!

btw,
if you want to update your application and the PC Studio shows you the old Game folder again and does not allow you to delete/rename it you have to delete your files from the phone by selecting settings menu > Memory settings > Clear memory ===> do this with care since you may loose all your pictures and possibly other files you care about ;-(

Sunday, December 21, 2008

Setting up OpenGL ES in Visual Studio 2008 with Device Emulator (WinCE+ Vincent + GLUT|ES)


Credits

All credits to the people that created these projects and tutorials
this is merely setup tutorial that may save some time.
A must read is the ZeusCMD
http://www.zeuscmd.com/tutorials/opengles/index.php tutorials

Installations and pre-requirements




  1. Visual Studio 2008 Professional Service Pack 1 ( http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx )
  2. Windows Mobile 6 SDK (http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en)
  3. Vincent OpenGLES CM (http://www.vincent3d.com/ and http://sourceforge.net/projects/ogl-es/ )
  4. GLUTES (http://glutes.sourceforge.net/index.php and http://sourceforge.net/projects/glutes/)
Environment Setup



  • Extract the ogles-bin-1.0.0.zip package and the glutes-1.11-src.zip and glues-0.1.zip to a local folder e.g. c:\gles\
  • Copy the GLES folders from c:\gles\ogles-bin-1.0.0\include and c:\gles\glutes-1.11\Inc and glues-0.1\Inc\GLES to a single GLES folder in the visual studio SDK
The relevant include directories of the platforms in the Visual Studio SDK directories are:

C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\PocketPC2003\Include
C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\Smartphone2003\Include


  • Copy the library files (without the .dll) from:

c:\gles\ogles-bin-1.0.0\bin\arm\Release

c:\gles\glutes-1.11-src\glutes-1.11\Lib\ppcarmv4rel

c:\gles\glutes-1.11-src\glutes-1.11\Lib\sparmv4rel

c:\gles\glues-0.1\Lib\ppcarmv4rel

c:\gles\glues-0.1\Lib\sparmv4rel

To the relevant Lib directories in the Visual Studio SDK:

C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\PocketPC2003\Lib\armv4

C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\Smartphone2003\Lib\armv4

- Please note that ppcarmv4rel libs should be located at the PocketPC2003 folder and the sparmv4rel should be located at the Smartphone2003 folder

- Please note that in case there it is not indicated the library files are copied to both configurations (in our case the libGLES_CM.lib and ug.lib are copied to both directories)

  • Setup the emulator and copy the relevant dll files

Open visual studio -> new project --> Visual C++ / Smart Device --> Win32 SmartDevice project --> give your solution a name4) buid the solution

Open device option dialog (from the emulator toolbar Pocket PC 2003 SE Emulator )

Select the device emulator you would like to use (e.g. Pocket PC 2003 SE Emulator ) --> Properties --> Emulator Options --> Shared Folder --> Enter a directory on your PC that will be used to exchange files between the PC and the emulator device e.g. c:\gles\emulator - than press OK to approve all the settings

  • Copy libGLES_CM.dll from C:\gles\ogles-bin-1.0.0\bin\arm\Debug to the shared folder c:\gles\emulator
  • Copy glutes.dll from the C:\gles\glutes-1.11\Lib\ppcarmv4rel to the shared folder
  • In the Visual Studion press Connect To Device icon - this will activate the emulator (if it is not already running no need) select Start --> File Explorer --> Storage Card
  • Long press --> select View --> All Files - now the dll files will be visible
  • Long press libGLES_CM.dll and select copy
  • Go to MyDevice --> Windows (this is the /windows of the emulator) --> press Edit --> Paste and do the same for the glutes.dll file

Testing the Setup and Running ZeusCMD GLES Sample application

  1. Test that the gles library is setup correctly start the visual studio File --> New -->Project --> Visual C++ --> Smart Device --> Win32 Smart Device Project
  2. Select a name for your solution
  3. In you main cpp file add the following include statement
    #include < GLES/gl.h >
  4. In the WinMain function before the message loop put the following

glShadeModel(GL_FLAT);

GLenum er = glGetError();

  • Build your solution put a breakpoint in the glGetError() line and press debug

If the emulator opens up the application is loaded and you stop at the right line this means you are on the right path the libGLES_CM is setup correctly

  • Copy the Sample cpp file and resource.h from the C:\gles\glutes-1.11\Sample to your project solution directory
  • Add these items to your project
  • Open the Sample.cpp file and remark out the GLUTES_STATIC definition --> //#define GLUTES_STATIC
  • Open the C:\gles\glutes-1.11\Src\glutes_main.c and copy the entire section from the line after

#ifdef GLTES_STATIC (in my copy it is line # 2476) untill the line before the corresponding #else (in my copy it is line # 2560 )

  • Paste this section insead of the WinMain code in your solution main cpp file - this will cause the application to call the main in the sample.cpp file and activate it.
  • Buid your solution and run / debug

If the application loads and runs than you have done it your environment is setup to run.

- I recommend that you use this as your template project and just replace the file containing the main.cpp file -

- This main.cpp file can be compatible with PC based glut applications as long as you keep with the API's as provided by the GLUTES team

- If you have questions leave me a note - I hope i can help.