red orange yellow green blue

Long time no post, now with XNA and Android experience

.
So it’s been roughly 3 months since I wrote anything here. Unfortunately I’m not the biggest blog poster in the world so things like this slip my mind.

In other news, currently working with four of my college friends on an XNA game that will hopefully be for download on Xbox in a month or two. The basic idea of the game is a vector graphics platformer, we haven’t seen one, so we decided to make one. You control a morphing object that can morph between certain shapes and use those to traverse the level. We’re currently working on getting networking down for multiplayer and the level editor complete with serialized objects.

Other than that, I’m currently working on a simple Android application to refresh on java and learn a new platform. It’s been done a ton of times, but a soundboard is a good starting application for phones. I’m hoping by the end of the week to have it finished. Only problem I’m currently facing is a long load time for the sound files. I’m sure the way I’m doing it isn’t the best and there are plenty of helpful places online for support for starting Android developers.

This is a very basic, not all inclusive look at what is going on. You have your main java file that extends TabActivity so your application can have multiple tabs. Then you use your Tab1 class to tell the intent, which is basically saying something is going to happen, to use the information in Tab1 and use setindicator to set the text on the tab and getdrawable to either use an image or refer to an xml file of what to draw. You then add this tab to the host of tabs.

public class MainJava extends TabActivity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);

       Resources res = getResources();
       TabHost tabHost = getTabHost();
       TabHost.TabSpec spec;
       Intent intent;

       // these three lines make a new tab
       intent = new Intent().setClass(this, Tab1.class);
       spec = tabHost.newTabSpec("tab1").setIndicator("Tab1",
    		   res.getDrawable(R.drawable.ic_tabimg)).setContent(intent);
       tabHost.addTab(spec);
}

public class Tab1 extends Activity
{
	Soundboard mSB;
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);

		// uses our nifty xml file
                // scrollview with linear layouts
		setContentView(R.layout.tab1);

                mSB = new Soundboard();
                mSB.InitSounds(getBaseContext());

                mSB.AddSounds(R.raw.soundname);

                Button SoundButton1 = (Button)findViewById(R.id.soundname);
                SoundButton1.setOnClickListener(new OnClickListener()
                {
			public void onClick(View v)
			{
				mSB.PlaySounds(1);
			}
		});
}

Comments are closed.