Thursday, April 28, 2011

Generate random numbers in Android app

Sometimes creating a series of random numbers in an Android app can be handy.

Create an object from the Random class. An example of this would be:

Random myNumber = new Random();

Then, just add your new object to your text field. Don't forget to add .nextInt to the end. Between your function's parentheses, add the number of random numbers you want in your range. For instance, if you choose the number 5, it will actually choose 6 because it starts at 0.

Interested in World War II? Download my WWII trivia game for iPhone- CODENAME:Trivia WW2

Wednesday, April 27, 2011

How to create an alert popup in iPhone

Alert boxes are helpful in iPhone development to give users a heads up if they are pressing an incorrect button or if they need to be given information in a game, etc.  Please see an example of an alert box below.

UIAlertView *alert = [[UIAlertView alloc]initwithTitile:@"title"];
[alert show];
[alert release];


Download new World War II trivia game available in the App Store

Tuesday, April 26, 2011

How to display an integer in a textview in Android

I know this is very basic, but still might be something people are looking for.

Let's say you create a textview object and create that text in your xml file, numbers will display with no problem. The problem comes in when you create an int variable and want to pass that value to your textview. Well, it can be done like this.

int myNumber = 55;

myText.setText(String.ValueOf(myNumber));


If you're interested in World War II trivia, my new iPhone game is for you. Click here to download.

Friday, April 22, 2011

New World War II trivia game available for iPhone, iPod Touch and iPad

If you're interested in World War II, this game is for you.


Test your knowledge of WWII in the most exciting and innovative manner that you’ve ever experienced. Learn about the Pacific, the Americas, the war in Europe and even the Holocaust. Discover the causes of the war and the leaders that influenced a series of events that changed history as we know it!

This iPhone app provides two different ways to test your skill level:

1. There is a series of quizzes that monitor your right and wrong answers to test both your knowledge and progress.
2. Also, there is a shake and answer tab. Basically, the app takes advantage of the iPhone accelerometer to provide a random question when shaken.
Experience the Greatest Generation like you never have before and download this app ideal for mature kids and older today!

World War II Trivia available in App Store

Wednesday, April 20, 2011

How to add action sheet to your iPhone app like one I almost used in my World War II Trivia game

In my most recent app, CODENAME: Trivia WW2, I was going to add an actionsheet to give game alerts. I decided against it at the last minute because I didn't want to give up screen real estate. But, this is a handy tool to add to iPhone apps. In Android, you can either use Toast or create a dialog popup theme. See my example below.

UIActionSheet *actionSheet = [[UIActionSheet alloc]initwithTitle:@"my title" destructiveButton:@"main" otherButtonTitles:nil};
[actionSheet showinView:self.view];
[actionSheet release];

Click here to download my World War II Trivia game for iPhone

Monday, April 18, 2011

Add Picker to iPhone app

I'm sure you've seen the spinning wheel in iPhone apps that allow you to choose an item. Adding a single picker to your app is pretty easy. Steps needed to take in order to add to your app.

1. Create an outlet for your picker in the interface file
2. Synthesize your picker name in the implementation file.
3. Create an array that initializes the objects within the array.
4. Tie it all together in interface builder.

Download World War II Trivia game CODENAME: Trivia WW2 from the iTunes App Store

Saturday, April 16, 2011

Mike Schwall Web Design Services releases World War II trivia game for iPhone

Test your knowledge of WWII in the most exciting and innovative manner that you’ve ever experienced. Learn about the Pacific, the Americas, the war in Europe and even the Holocaust. Discover the causes of the war and the leaders that influenced a series of events that changed history as we know it!

This iPhone app provides two different ways to test your skill level:

1. There is a series of quizzes that monitor your right and wrong answers to test both your knowledge and progress.
2. Also, there is a shake and answer tab. Basically, the app takes advantage of the iPhone accelerometer to provide a random question when shaken.
Experience the Greatest Generation like you never have before and download this app ideal for mature kids and older today!

Friday, April 15, 2011

Add a ScrollView to an Android app layout

In order to add a ScrollView into your Android app layout, we have to first edit the XML file. Nested inside of your ScrollView tags, you have to have a Linear Layout. It should look like this.

<ScrollView
android:layout_width="fill_parent"
android:layout_height="300px">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="Wrap_Content"
>
Add whatever you want to scroll in here
</LinearLayout>


</ScrollView>


Click here to download my World War II Trivia iPhone app CODENAME:Trivia WW2

Thursday, April 14, 2011

Using the switch statement on iPhone or Android

Sometimes using a switch statement can save some space instead of using a bunch of if/then/else statements.

for example:

switch(total) {

case 30.00:
UIImage *img1 = [UIImage imageName:@"filet.jpg"];
break;

case 5.00:
UIImage *img1 = [UIImage imageNamed:@"fastfood.jpg"];
break;


Download World War II trivia game for iPhone

Wednesday, April 13, 2011

Using the while loop

The while loop is a great way to run a condition as long as a statement remains true. For instance, see code below.

int counter = 0;

while (counter < 500) {

label.text = [NSString stringWithFormat:@"%@",counter];
counter++;
}

Download WWII Trivia game for iPhone

Tuesday, April 12, 2011

Setting up Ajax in your iPhone or Android app

In order to get Ajax to work, you will need CSS believe it or not. You need to create an id container where the info is going to get pulled into. For instance, add the following:

<CSS type="text/css" media="mobile">
#container   {
width:whatever pixels;
float:left or right;
}
</css>
Now reference, your php file from your link like this:
<a href="javascript:void();" onclick="funtionname("phpfile name",1,'container');">link</a>

Check out this WWII iPhone trivia game in iTunes App Store- Codename: Trivia WW2

Saturday, April 9, 2011

WWII iPhone app

Not much going on today, but working on a few new apps for both iPhone and Android. In particular, working on a switch views method to go from one nib file to another. It's not hard at all, but it's easy to get lost in your nested if/then statement. I probably should have used a switch instead, but I didn't. I'm definitely not going back and redoing all of that.

Anyway, check out my latest iPhone app in the iTunes App Store Codename: Trivia WW2.  The app allows users to gauge their knowledge from one quiz to another and calculates your score. There is also a shake and answer section of the app that takes advantage of the iPhone accelerometer. When you shake the phone, it goes to another question. I think it's pretty cool and I hope you do as well. The questions range from The Battle of Midway to The Battle of The Bulge, Pearl Harbor, the Holocaust, movies, music, pop culture and more. I took several months researching, coding, designing graphics and pulling everything together into one piece.

So, download this WWII Trivia iPhone game today that's good for mature kids and older today. Also, have a great weekend.

Friday, April 8, 2011

Create a multidimensional array in php

Although this is unrelated to iPhone and Android app development, that's ok. Please see brief tutorial below on creating a multidimensional array in php.

<?php

$images=array(
array('file'=>'image1'),
array('file'=>'image2'),
array('file'=>'image3')
);

?>

Click here to download iPhone WWII Trivia app

Thursday, April 7, 2011

Set Preferences for iPhone app

Setting preferences within an iPhone app can be somewhat frustrating at times. With ios, the setting changes don't take effect until the app is taken out of memory and then reopened. But, here's a good way to do it.

NSUserDefault * myPrefs = [NSUserDefaults standarduserdefaults];
[myPrefs setObject:textfield.text];


New World War II iPhone app in the app store- CODENAME: Trivia WW2

Wednesday, April 6, 2011

How to validate a textfield in Android

Determining the value of a text field string in Android is very easy. At first, I was making this much more complicated than it actually is. See below:

EditText myEdit;

myEdit = (EditText) findViewById(R.id.edit1);

if (myEdit.getText().equals("Text to search for")) {

// whatever you want it to do

}

Tuesday, April 5, 2011

Android, iPhone and Swamp People

Last night, I was typing out Objective-C and Java for more iPhone and Android app ideas when I saw Swamp People taped on my DVR. This is a pretty good show. Some guy got his finger nearly taken off by an alligator. Anyone watch it this week?

Monday, April 4, 2011

Tab Bar Android

Early this morning, got my TabHost and TabWidget working pretty good. It was a little easier than I thought it would be. Still doesn't work as well as UITabBarController on the iPhone. Oh well, it is what it is. Maybe I'll feel different about it after the entire app is completed.

Sunday, April 3, 2011

Working on more iPhone apps

Today, continued working on a few new ideas for iPhone apps. I am also going to begin working on Android as well. I'm not as familiar with the Android ecosystem, so I'm taking my time. I do find many similarities, so that was a pleasant surprise. If you get a chance, check out my most recent trivia game in the Apple App Store. Codename: Trivia WW2 is a WWII based trivia game that tests your knowledge on leaders, battles, movies and even music. It's pretty cool, but I guess I am biased. The app can be downloaded by clicking here.

Saturday, April 2, 2011

Adding a map in Android App

I was finding the Google Maps api a little more frustrating in Android than with iPhone, especially in creating a native app. I think the best work around will be to add a Webview and enable javascript in my preferences. Let me know if you have other ideas.

Friday, April 1, 2011

Testing Android app

Yeah, I've been working on Android app development, but there is one problem. I don't have an Android phone. Previously, I have created several iPhone apps, including my most recent one Codename: Trivia WW2. Anyway, I'm torn between whether or not to buy an Android phone just for programming purposes. Working on the emulator may not be enough. It also seems more challenging from the perspective that the screen sizes are so different. I just hope it doesn't look like crud on certain phones. Apple definitely makes it easier. Oh well, we'll see.