GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - "Learning Android" Project
View previous topic :: View next topic  
Author Message
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Tue Sep 01, 2009 11:54 am    Post subject: Development Log - "Learning Android" Project Reply with quote

As already mentioned in the off topic thread, here's my Android dev log.

Evening 1
My Samsung Galaxy hasn't arrived yet but I've already set up the development environment, just to be prepared.

The recommended software for developing for the Android platform amounts to about 450MB of stuff(on a Windows platform).

More specifically, as listed here, I had to download the latest version of Eclipse(ca 190 MB), JDK6(ca 74MB) and the Android 1.5 SDK(ca 182MB).

I also downloaded the ADT (Android Development Tools (a plugin for Eclipse)) which turn Eclipse into "a powerful, integrated environment in which to build Android applications. It extends the capabilites of Eclipse to let you quickly set up new Android projects, create an application UI, add components based on the Android Framework API, debug your applications using the Android SDK tools, and even export signed (or unsigned) APKs in order to distribute your application."(--quoting the installation instructions from developer.android.com)

Following the instructions on this page I noticed that Eclipse downloads some more files upon installing the ADT, even if you downloaded the zipped version and install from there, so internet access is necessary to install the environment for the first time.

All in all, the installation went very well, no problems encountered, no errors at all, no obscure settings to set anywhere, nothing. :)


So I continued to read some more about basics of Android development and soon discovered that I don't even need an actual hardware phone to start developing, as the SDK comes with a free device emulator for which you can create any number of so called AVDs (Android Virtual Devices) and run the compiled software on those.

blah blah blah <boring details about how I continued to read the docs/> blah blah blah

Factoids about Android development that I gathered from the docs so far:
+ you develop your apps in Java
+ your apps are not compiled to Java VM Bytecode
+ your apps are instead compiled to Dalvik VM code
+ the Dalvik VM relies on a Linux kernal for threading and memory management
+ every Android app runs it its own process and in its own VM
+ Dalvik VM executes .dex (Dalvik executable) format
+ Dalvik VM is register-based

something I'm not sure about:
+ Android does not execute Java applications and does not have a Java VM
(I'm still a bit confused about the differences between the Java VM <-> Dalvik VM (which in some docs is also referred to as Dalvik Java VM))

more facts:
+ Android uses a set of C/C++ libraries at its core for performance critical portions of code and it's possible to write your own performance critical code in these languages and use it in your apps, by utilizing what is called the NDK (native development kit)

...
Alright, the more theory I read the more I'm bored, I wanted to get my hands dirty on this stuff, so I just selected new Android application from the Eclipse menu and it created a basic package for me, which I then ran.

After a few more screens(for creating an AVD) which were all self-explainatory, I could run it in the Android emulator. The boot time for the emulated Android system was about 50 seconds on the first run. Now it is about 10 seconds (even after restarting Eclipse or doing a hard reset of the dev machine).

obligatory screenshot:

All it does is displaying a single default View and two of the resources that are packaged into the output file (all of which was done automagically by the new app wizard / only thing I had to do was change the resource string :P).

nice things I noticed about the emulator:
+ all the buttons work as expected
+ the emulator has full access to the internet through your computer
+ it's possible to limit the emulators network bandwidth, e.g. to GPRS speed

not so nice:
- you can't install any applications from the market into the emulator (so I couldn't test the SCUMM VM port or the C64 emulator yet (two more reasons for why I can't wait for the real phone to arrive ;) )

Well, that's it for now. My plan is to write a simple Tetris or Pong game first to familiarize myself with the SDK and with the overall architecture of Android apps.

I haven't yet decided whether I'll continue to develop anything else for Android after that. I guess it depends on how much time I can set aside and how much fun it is. I don't plan to make any money from it so I'm doing this just for my personal entertainment. :)

It's the first time I'm developing something for a portable platform, something that I can take with me wherever I go, so I'm very excited.
_________________
0xDB
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10857
Location: Canadia
PostPosted: Tue Sep 01, 2009 12:10 pm    Post subject: Reply with quote

Quote:
I haven't yet decided whether I'll continue to develop anything else for Android after that. I guess it depends on how much time I can set aside and how much fun it is. I don't plan to make any money from it so I'm doing this just for my personal entertainment. :)

Because it's educational and for your own amusement, I'll be good. Android should be a heck of a step up from J2ME, which I personally consider synonymous with breaking your arms and legs and being told to make a game (The "J" part is ok, the "ME" part with all the many handsets with subtle variations that aren't compatible is the whoa part).

I posted this in off topic, but I'll repeat it since it's relevant to your Android endevours.

http://larvalabs.com/blog/iphone/android-market-sales/

At the moment, the Android device marketplace isn't very profitable. It could change down the road, then it's certainly worth knowing this stuff if you're job hunting. Just be sure you get paid a wage, and not with royalties and bonuses.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
n29
Developer

Joined: 13 Sep 2005
Posts: 879

PostPosted: Tue Sep 01, 2009 4:57 pm    Post subject: Reply with quote

My experience with J2ME consisted of a school project which was quiet involved (communication between phones using sms messages and fetching yahoo map pngs). Although we were provided phones, I only ever got it to run on the emulator. Still got an A though. So yeah, Android should rock compared to J2ME. But... you never know how bad implementors can eff things up.
View user's profile Send private message
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9441
Location: Not Finland
PostPosted: Fri Sep 04, 2009 1:01 pm    Post subject: Reply with quote

That's... a rather nice looking phone, I must say! It strongly resembles a Palm Lifedrive.

View user's profile Send private message Visit poster's website
Devlin
Member

Joined: 04 Sep 2009
Posts: 16
Location: United Kingdom
PostPosted: Fri Sep 04, 2009 1:51 pm    Post subject: Reply with quote

I have a T-Mobile G1.. I shall keep an eye out for your stuff in the future.
_________________
What does the Scouter say about his caffeine level? WHAT?!? It's over 9000!?!?
DevlSoft
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sun Sep 13, 2009 5:02 am    Post subject: Reply with quote

Day 2
My Samsung Galaxy arrived on Wednesday 3rd of September already (pictures will follow later).

I haven't had time to do any development since then (way too busy testing all those cool apps from the market and famliarizing myself with the phones functions/mp3 player/compass/google maps/gps stuff(I have so far only made a single actual call with this thing)...).

Lots of playing Bonsai Blast, Robo Defense, two firmware upgrades (and some mixed in-between girl/love/identity/etc. troubles) later and some problems installing the Samsung software on different machines(32bit and 64bit) only to find out that the Galaxy is not yet supported by their "PC Studio", I turned back to my original motivation for getting this device: to develop some stuff. :)

Since I'm not at my regular machine atm, I had to reinstall Eclipse and everything to start getting "back into it"(yeah, how can you get back into it, if you've never really been into it?).

Problems started when I tried to run the AndroidDeviceEmulator on this fairly outdated old 2GHz,1GB RAM 32bit single core slowtastic nightmare of a dev. machine (not to mention Eclipse being sluggish as fuck on here) but to make a long story short, I decided to run my HelloWorld app on the real phone.

That didn't prove to be easy though, as the USB driver for the integration of real world devices into the Android SDK only seemed to support a couple of different devices: The T-Mobile G1, The HTC Magic and a special Android Dev. Phone which sells for about 399$.

So... what to do? Android Dev Community to the rescue! I found a thread where other Galaxy owners had successfully changed the supplied ".inf" file of the USB driver to trick it into installing itself for the Galaxy. Unfortunately, their modifications didn't work for me, as I seemed to have a different device id, so I had to look up the correct hardware device id in the windows device manager(the galaxy was listed there as an unknown device), modify the ".inf" file and hooray, driver installed. successfully.
(I hope this little fix will work for the 64bit version of the drivers as well for when I'll be back at my main machine.)

Now I can run my HelloWorld application directly on the hardware without having to package and manually install it.

Next up, I have to make a plan for what to develop and flesh out all the tasks necessary to accomplish that. I'm leaning towards a Tetris clone.

Quote:
At the moment, the Android device marketplace isn't very profitable. It could change down the road, then it's certainly worth knowing this stuff if you're job hunting. Just be sure you get paid a wage, and not with royalties and bonuses.
Hehe, yeah those numbers don't look encouraging at all. Luckily I already have a job as a software developer (not game dev though).

Quote:
So yeah, Android should rock compared to J2ME. But... you never know how bad implementors can eff things up.
The main problem that Android developers will have to deal with is differences in hardware devices. iPhone devs can pretty much rely on a fixed set of sensors/keys/other means of input. Android devices don't all share the same set of input sources. As an example, the Doom port for the Android is nearly unplayable on the Galaxy, simply because it was originally developed for a device which had a full keyboard attached to it. The Galaxy does not have a keyboard and only very few buttons that can be freely assigned (I hope that someone will eventually add proper touchscreen/sensor controls to that Doom port).

Quote:
That's... a rather nice looking phone, I must say! It strongly resembles a Palm Lifedrive.

The phone in the screenshot is just some default skin for the device emulator. The actual Galaxy does look similar to the Lifedrive indeed.

Quote:
I have a T-Mobile G1.. I shall keep an eye out for your stuff in the future.

Don't expect anything too soon though. With my chronic lack of motivation/time and lazyness increasing on a daily basis, I don't expect myself to have anything showable ready until the end of this year (and then there are other projects that I'm already busy procrastinating on (networking prototype/spacegame/a secret sequel to F.S.a./learning OpenGL for a new version of TankGame)).
_________________
0xDB
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10857
Location: Canadia
PostPosted: Thu Oct 15, 2009 2:00 am    Post subject: Reply with quote

Seems Android is on my radar now.

http://developer.android.com/sdk/ndk/1.6_r1/index.html

The "NDK" seems to let you write native library code in C/C++. Version 1.6 includes support for OpenGL ES 1.1 (i.e. same as iPhone). So, you could theoretically write "library" code that's essentially a port of your C/C++ game, then manage it through a lightweight Java App that forwards system messages (similar to how you work with ObjC and C++ on iPhone).

Only questions I have are ones of system/graphics performance, as well as how audio is handled. I suppose you could add a thin layer, a function callable by the Java that reads a requested sound play queue, or raw mixed sound.

- - - -

Quake port: http://code.google.com/p/glesquake/

The Java part looks quite light. A direct link in to the repository is here:

http://code.google.com/p/glesquake/source/browse/#hg/src/com/android/quake
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - "Learning Android" Project

Use this link to get a Sign-On Bonus when you get started!

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.