Android Development: Wikiwar

My latest project that Im working on is an app for a college project. Its a group project with two other people. Its called Wikiwar and its a game that users must navigate through wikipedia linking different pages together. I think it works well for the project as it combines some nice android development techniques with a fun game mechanic. My work has started on creating a leveled mode. The mode consists of a number of preset starting and ending points on wikipedia and the player is rated by how few “clicks” or links they use to get from start to end. Android development is somewhat different to normal programming but I enjoy it quite a bit.

I started by storing the urls to the pages in the strings.xml file. Then I created buttons on the menu activity. Then in the xml for the button I use android:onClick and load a method in the java file. This method starts the game activity and and passes in the two relevant urls from the strings.xml. Each button will have its own method to load the correct data to start the game.

public void loadFour(View v)
{
Resources res = getResources();
String start = res.getString(R.string.nfl); //load string from xml file
String end = res.getString(R.string.nhl);
Intent intent = new Intent(this,StandardActivity.class);// creating an intent to launch the about activity
intent.putExtra("start_url",start); // pass in url strings to activity
intent.putExtra("end_url", end);
startActivity(intent);
}

<Button
 android:id="@+id/levelFour"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignLeft="@+id/levelTwo"
 android:layout_below="@+id/levelThree"
 android:onClick="loadFour"
 android:text="@string/four" />

About these ads
Tagged , , ,

13 thoughts on “Android Development: Wikiwar

  1. Appreciate this post. Let me try it out.

  2. Great post. I was checking constantly this blog and I
    am impressed! Very useful info particularly the last part :) I care for such information a lot. I was looking for this certain info for a long
    time. Thank you and good luck.

  3. Greate post. Keep posting such kind of info on your page.
    Im really impressed by it.
    Hey there, You’ve performed a great job. I’ll certainly digg
    it and individually suggest to my friends.

    I’m sure they’ll be benefited from this website.

  4. Jordan says:

    What’s up, after reading this remarkable post i am also cheerful to share my experience here with mates.

  5. What’s up, I want to subscribe for this web site to obtain most up-to-date updates, thus where can i do it please help.

  6. Good Page U Made Here! Very Informative Subject For A Post Keep Up The Really Good Ideas!. Check Out My Winnipeg Computer Repair Blog And Tell Me What You Think!!!!

  7. Bette Mysak says:

    Very nice post. I absolutely appreciate this site. Keep writing!

  8. I was very happy to uncover this page. I need to to thank you for ones time just for this wonderful read!

    ! I definitely really liked every little bit of it and I have
    you saved to fav to check out new things in your website.

  9. Abraham says:

    Hey! I’m at work browsing your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the excellent work!

  10. Thanks in favor of sharing such a good opinion, piece of writing is nice, thats why i have
    read it fully

  11. Normally I do not read article on blogs, but I would like to say that this write-up very pressured me to take a look at and do it!
    Your writing style has been surprised me. Thank you,
    very nice post.

  12. Hey there, You have done a fantastic job. I’ll definitely digg it and personally suggest to my friends. I’m confident they
    will be benefited from this website.

  13. Alton says:

    Right here is the perfect website for everyone who would like to find
    out about this topic. You know so much its almost tough to argue with
    you (not that I personally would want to…HaHa).
    You certainly put a brand new spin on a subject that’s been written about for years. Great stuff, just wonderful!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: