Meet up on June 22nd - OpenGL talk

2 views
Skip to first unread message

PaulT

unread,
May 30, 2009, 5:24:01 AM5/30/09
to LondOnAndroid
Hello everybody,

Carl has kindly given me a bit of time to talk about writing
applications which use the OpenGL API on Android at our June 22nd
meeting.

OpenGL is designed to allow the programmer fast access to hardware for
rendering 2D and 3D shapes. Although it had its origins in high-end
CAD systems, OpenGL is an excellent lightweight API for games as well.

I've written my first Android OpenGL game and you can now download
this from the Market (it's free). In fact, it would be a really good
idea to do this before the meeting as we will be talking about how
this app was constructed.

The game is called Voxel Fun (there's nothing else with anything like
this name on the Market) and you can see screenshots and videos at
this URL:

http://sites.google.com/site/drpaulthomasandroidstuff/Home/voxel-fun

I'm afraid it doesn't run on the emulator. I think there are some
issues with the 3D rendering maybe?

Looking forward to seeing everybody on the 22nd!

Kind regards
Paul.

Carl-Gustaf Harroch

unread,
May 30, 2009, 7:52:39 AM5/30/09
to london...@googlegroups.com
Hello Paul,

Very nice and addictive game!

One little bug that you might want to quickly fix. When the screen orientation changes, the cube is reinitialized which I believe would get frustrating if you are close to the end (I am running Hero's rooted 1.5 and the screen orientation is automatically changed when moving the phone). A simple fix, would be to have your activity defined in your manifest as follow:
<activity android:name="<classname>" android:screenOrientation="portrait">

Looking forward to get some more insight on the 3D engine and thanks again for presenting this.

Another note, a lot of things happened during Google IO and I (actually Kevin) have some exciting news about the group which I will discuss in the next meeting.

See you on the 22nd!

./Carl

2009/5/30 PaulT <dr.paul...@gmail.com>



--
Carl-Gustaf Harroch

Paul Thomas

unread,
May 30, 2009, 8:35:37 AM5/30/09
to london...@googlegroups.com
2009/5/30 Carl-Gustaf Harroch <char...@gmail.com>:

>
> Very nice and addictive game!

Thanks, glad you like it!

> One little bug that you might want to quickly fix. When the screen
> orientation changes, the cube is reinitialized which I believe would get
> frustrating if you are close to the end (I am running Hero's rooted 1.5 and
> the screen orientation is automatically changed when moving the phone). A
> simple fix, would be to have your activity defined in your manifest as
> follow:
> <activity android:name="<classname>" android:screenOrientation="portrait">

Ah, nice one, thanks. Seems to work in dev, but I've just downloaded
a new version I've just put on the Market and it doesn't seem to
behave in quite the same way. Curious, I will look into it.

Something else you might know, where is the right place to store
persistent data such as saved games? I'm making a directory on the SD
card at the moment, but this has a couple of problems. If you don't
have the SD card, no saved games. Also, it won't get uninstalled if
you remove the application. Is there somewhere else I should be
putting these files?

> Another note, a lot of things happened during Google IO and I (actually
> Kevin) have some exciting news about the group which I will discuss in the
> next meeting.

Great. Looking forward to a good meeting!

Kind regards
--
Paul Thomas // Mobile 07969 092 437
http://sites.google.com/site/drpaulthomasandroidstuff

Carl-Gustaf Harroch

unread,
Jun 1, 2009, 4:09:04 AM6/1/09
to london...@googlegroups.com
You can use /data/data/<package>/files by using the context. This might not be the best place as I believe there is only 30Mb of space for apps and its file. If it is a rather small file then it could be a solution. The only other solution is the SD card.

context.openFileOutputStream(name, mode)





2009/5/30 Paul Thomas <dr.paul...@gmail.com>



--
Carl-Gustaf Harroch

Kevin McDonagh

unread,
Jun 2, 2009, 8:44:36 PM6/2/09
to london...@googlegroups.com
Yeah the recommended approach is to use the SDcard for persisting ingame/app data.

There is a good example in the manning book unlocking Android which you can see here:
http://code.google.com/p/unlocking-android/source/browse/chapter5/trunk/FileStorage/src/com/msi/manning/chapter5/filestorage/ReadWriteSDCardFile.java


Regards,
Kevin McDonagh
Android Application developer

E: ke...@novoda.com
M:+44 07 981 932 411

S: http://novoda.com
B: http://novoda.com/blog
Chat: Google Talk: novoda1 Skype: novoda.com MSN: novoda1
Contact Me: Linkedindel.icio.usTwitter


2009/6/1 Carl-Gustaf Harroch <char...@gmail.com>

Paul Thomas

unread,
Jun 8, 2009, 7:30:26 AM6/8/09
to london...@googlegroups.com
2009/6/3 Kevin McDonagh <applet...@gmail.com>:

> Yeah the recommended approach is to use the SDcard for persisting ingame/app
> data.
>
> There is a good example in the manning book unlocking Android which you can
> see here:
> http://code.google.com/p/unlocking-android/source/browse/chapter5/trunk/FileStorage/src/com/msi/manning/chapter5/filestorage/ReadWriteSDCardFile.java

That's cool. This is what I am doing at the moment. But the system
will not remove that when the app is uninstalled. I know this is the
usual behaviour for a lot of pc-based games, but I thought it would be
tidier to nuke it on the handset.

Looking at Context.openFileOutput(name, mode) it seems that the
filename cannot contain path separators, so I guess this is being put
into the application's own storage and will be junked when the
application is deleted. Could somebody who has a rooted phone verify
this? I can't see inside /data on my production phone.

I only need to store a few kBytes, so I don't think I need to worry
about exhausting local storage.

Reply all
Reply to author
Forward
0 new messages