Arrays for Interactive Android app

The use of arrays were critically important for the development of our latest app, “Mars Bubble Pop Lander”. It is very important to make use of proper Java coding structure and design and the Model-View-Controller system to keep track of the flow of object data and the design of Java classes.

As an interactive story written in Java and Android SDK, the user is allowed to enter their name and navigate through pages within the app with important code:

mImageView = (ImageView) findViewById(R.id.storyImageView);
mTextView = (TextView)findViewById(R.id.storyTextView);
mChoice1 = (Button)findViewById(R.id.choiceButton1);
mChoice2 = (Button)findViewById(R.id.choiceButton2);

The use of a simple array allows the code to fetch the correct page because on interactive choices made by the user when navigating through the app.

By setting a Java ID for the “Start your Adventure” start button, we can capture the name of the user and record it in a Log.d file which is verified due testing with the SDK Emulator.

mNameField = (EditText)findViewById(R.id.nameEditText);
mStartButton = (Button) findViewById(R.id.startButton);

The basic structure of this app can be inspiration for other story telling apps with even longer narratives and complexity of plot depending on the number of pages required in the story array:

private Page[] mPages

Clean coding is critical to the design of a great app. Establishing Java classes and organization of objects and methods in this project were crucial to the design of the Mars Bubble Pop Lander app.

Leave a Comment

Please log in using one of these methods to post your comment:

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