Wednesday, 7 October 2009

Pro Android 2 Games


Product Description

Do you remember games like Wolfenstein 3D, Doom, and Asteroids? Well, here�s a fun opportunity to build and/or port these games to one of the hottest mobile and netbooks platforms today: Google�s Android.



Pro Android 2 Games lets you get going with building cool games like Space Blaster and the classic Androids from scratch on the latest Android platform. This book also shows you how to port other classic freeware/shareware games like Doom and Wolfenstein 3D from C using the Java Native Interface (JNI) for Android.

Although C is not yet formally supported in Android, author Vladimir Silva will show you how to make it work. This book takes you beyond Android fundamentals and into the world of game development hacks and fun. Perhaps you�ll even make some money. Enjoy!

What you�ll learn

  • How to write/port advanced 3D games for any Android device
  • Details on installing the development software, including tool chain compilers and IDEs, and setting up the overall environment
  • How to create a Java-based Space Blaster game on Android
  • How to build a Java-based Androids-like game on Android
  • How to hack and port high-performance games through JNI and onto the Android platform
  • How to port the classic, C-based shareware/freeware Doom and Wolfenstein3D games to the Android 2 platform.

Who is this book for?

This book is for Google Android developers interested in game application development in Java or porting existing C-based games via JNI into Android and developing/deploying from there. This book is also for those interested in mobile game development looking to see what Android can do for them.

About the Author

Vladimir Silva holds a master�s degree in computer science from Middle Tennessee State University. He worked for four years for IBM as a research engineer where he acquired extensive experience in distributed and grid computing research. Vladimir is a highly technical, focus�based individual and team player. He belongs to two National Honor Societies and has published many computer science articles for IBM and is author of Grid Computing for Developers (Charles River Media, 2005).

This title has not yet been released.
You may pre-order it now and we will deliver it to you when it arrives.
Ships from and sold by Amazon.com. Gift-wrap available.

Tuesday, 6 October 2009

Talking AlanlogClock, using Text-To-Speech function.

Extends from previous article; Android AnalogClock and AndroidSpeech: Android can speech! this exercise implement a analog clock with speech function. When you click on the analog clock, the current hour and minute will be speeched.

Create a basic Analog Clock application following the article Android AnalogClock, with the target platform set Android 1.6, because we have to use the Test-To-Speech function.

Add TextView in main.xml, it's helpful for checking.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<AnalogClock
android:id="@+id/myAnalogClock"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="I can speech"
/>
<TextView
android:id="@+id/myText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>

</LinearLayout>

main.xml can be downloaded here.

Implement AnalogClock.OnClickListener to start the speech once the AnalogClick is clicked. In AnalogClock.OnClickListener, the current time can be retrieve by Calendar.getInstance().

AndroidClock.java
package com.exercise.AndroidClock;

import java.util.Calendar;

import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.AnalogClock;
import android.widget.TextView;


public class AndroidClock extends Activity implements OnInitListener {

TextToSpeech myTTS;
AnalogClock MyAnalogClock;
TextView MyText;

private int mHour, mMinute;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

myTTS = new TextToSpeech(this, this);

MyAnalogClock = (AnalogClock)findViewById(R.id.myAnalogClock);
MyAnalogClock.setOnClickListener(MyAnalogClockOnClickListener);
MyText = (TextView)findViewById(R.id.myText);

}

@Override
public void onInit(int status) {
// TODO Auto-generated method stub

}

@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
myTTS.shutdown();
}

private AnalogClock.OnClickListener MyAnalogClockOnClickListener
= new AnalogClock.OnClickListener(){

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

final Calendar c = Calendar.getInstance();

mHour = c.get(Calendar.HOUR_OF_DAY);
mMinute = c.get(Calendar.MINUTE);


String myTime= "Now is "
+ String.valueOf(mHour)
+ " Hour "
+String.valueOf(mMinute)
+ " Minute";

MyText.setText(myTime);
myTTS.speak(myTime, TextToSpeech.QUEUE_FLUSH, null);
}
};
}

AndroidClock.java can be downloaded here.

Monday, 5 October 2009

MySQL Getting Started Guide

MySQL Logo

I actually posted a short MySQL guide a week or two ago, but haven't blogged about it.The Getting Started with MySQL page is a little cheat sheet to help me set up and administer a MySQL server and DB.



It certainly has helped with my CodeIgniter projects. It is not finished yet, but hopefully there is enough there to help others.

Saturday, 3 October 2009

All Done - New Design Finished

The new design is all finished. I found that I had modified my blog template to the point where it essentially was the default Minima template. So I decided it would be best to install that base template and tweek things back to where I wanted.



Also, the old design was getting a little too boxy for me. This setup really dials that back.

Updating Template

I'm updating the template for my blog today. So things may look funky for a while. Will post again once I'm finished.

Friday, 2 October 2009

Umbrella & TinyTSS - iPod Touch 3g support

I've decided the changes I've made to Umbrella warrent a brand new post. What you'll find in the latest version of Umbrella is:
  1. Native Mac OS X Application
  2. Built - in GUI
  3. The .exe files now are console-less.
  4. The saved shsh files are in the format {ecid}-{version}.shsh
  5. Various code-cleanup under-the-hood.
I've decided to keep the link for the older version active simply because I removed the console for this version.

The new umbrella app is incredibly simple to use. The UI consists of a text field a couple combo boxes and a button.

1. Enter your ECID - I do my best to detect whether you input the ecid in hex or decimal.
2. Select your device and firmware version to obtain the shsh blobs for
3. Select which repository to query - Apple is ofc apple, Saurik is ofc saurik and localhost is for testing TinyTSS (you shouldnt typically need to select localhost)
4. Click the big submit button.

If all goes well your file will be saved in the current directory with the name -.shsh. If that file already exists, the app will ask you for a new name for the file or if you just want to overwrite the file hit cancel. If you leave the name blank the file will be discarded.

That's pretty much it. Oh. Incidentally. The readme is a bit out-dated. :) I really don't care enough to fix it.

UPDATE: If you have a Mac and happen to be using the .dmg be sure you copy the Umbrella application to your desktop or some other location OUTSIDE of the .dmg as the application won't be able to save your .shsh file unless the application is running OUTSIDE of the .dmg file. Sorry for the inconvenience.

UPDATE: I've worked out with Saurik the server to point to on his side to ensure your shsh files are saved on his machine as well as on your machine. The default repo is still 'Apple' but if you select 'Saurik - Cydia' then the request will be sent to his server and forwarded to Apple. Then the file will come back to you and you will have the file locally and Saurik will have it on his server(s).

UPDATE: I've added 3.1.2 support as well as parsing the temporary directories you may have saved for a 3.0 or 3.0.1 restore... (actually it will detect any restore files from 3.0 up for iphone and 3.1.1 for ipt 2g/3g). TinyTSS will recreate your shsh file if you pass the PARENT directory of the TMP directories that you saved. For example, if you saved Per123.tmp AND Per321.tmp and put them in a directory named /tmp you would run tinytss with:

java -jar tinytss.jar -f /tmp

And tinytss will try looking inside of tmp and the first level subdirectories for device restore files.

Keep in mind, if you don't have all of the image files you need, you will not be able to create your shsh file. Period.

Thanks to theheadfl for info on parsing the apple image files!

Download it above.

If you need an md5 checker I like: Nirsoft's MD5 Checker

Thursday, 1 October 2009

Yahoo Releases YUI 3


Ajax Logo

Yahoo has released version 3 of their YUI Ajax library. Check out write ups on Webware and the Yahoo blog post.


I haven't tried YUI yet. More a matter of time than anything else. But it looks like a good library.