We’re on the move

Over the next 24 to 48 hours, TPA will be in the process of moving to a new, updated web server.  We’ve already changed some major information with the new web host, so possible interruption of services could pop up at any time.  The move will give us even more flexibility to expand this web site for our readers.

Thanks for your understanding during this time,

Dan Uff
Senior Editor, TPA

News: Apple pushes out 5th Beta of Mac OS X 10.8.4

OSX108UpdateAnother six days have gone by, and thus another pre-release beta of the forthcoming 10.8.4 Mountain Lion has been seeded to developers for testing. The new build, 12E40, again lists no new changes or known issues, and asks developers to focus on the same areas as before: graphics, Safari and Wi-Fi performance. While not mentioned in the notes, the upcoming update adds support for the emerging 802.11ac wireless protocol.

Via: MacNN.com / AppleScoop.com

News/Rumor: Apple to introduce new XCode environment later this year

XCodeLogoAccording to our sister web site AppleScoop.com going on a tip from 9to5Mac.com, Apple is said to be redoing its XCode developers environment to be introduced later this year.  The update could see a major revamp of the look and its testing tools.

No other information was available.

Obj-C: How to do basic math (Part II)

On March 20th, I showed you how to do basic math in Objective-C.  Now let’s take it a step further.

Suppose you need to add 4 numbers, and then divid that by 5.  The problem says that you must add the numbers first before dividing them by 5.

A long time ago (when I wrote in BASIC) I learned a technique that even works today.  You use the open bracket “(” and close bracket “)” to tell the computer what to calculate first.  When that is done, then it will go on to the rest of the problem.  Here’s how it works:

int a = 34;
int b = 12;
int c = 56;
int d = 87;
int answer = 0;
answer = (a + b + c + d) / 5;

Let’s break it down:

1. We initialize A – D with numbers for our math problem.
2. Since the answer variable will show the final answer, we initial it with the number zero (0).
3. The answer variable will first add what ever is in-between the brackets (), and then go on to divid that by 5.

The way to show the value of answer depends on your needs.  You could use a NSLog statement or a label.

That’s it.  Happy coding!

NEWS RELEASE: TPA Expanding its “Help” Web Site Again

JoomlaLogoSince its inception, The Programming Assistant (TPA herein) has helped millions of programmers understand how to write programming code such as C, C++, Java, and Obj-C.  TPA gets thousands of hits each day, with that number growing.

TPA is expanding its reach in to CMSs (Content Management Services) by providing how to articles on the popular JOOMLA web site creation tool.  Joomla helps individuals design, maintain, and develop professional looking web sites via a menu driven Administration tool (called the backend).  Our senior writer, Dan Uff, has been working with this application for weeks and has decided to share his dos and don’ts about this creation tool.  This application also deals with HTML, CSS, and more.

So, look for articles dealing with the above sometime in the near future.

Considering writing Android apps? Here’s what you need now

AndroidLogoNoTitleNow that I outlined what a developer needs to make iOS Apps, I thought I’d do the same thing for Android.

Q: What hardware do I need to develop for Android?

A: Unlike developing for iOS, someone can use almost any type of computer (Linux, Mac, Windows) that has the capability to have at least 1 Gigabyte of RAM.

Q: What about software?
A: Even though their are different environments to program for Android, I like programming in a Graphic Users Interface (GUI).  I recommend a program called Eclipse which you can download for free here.  But to make it even easier, Google has finally combined everything you need in one convenient archive.  For more information, click here.

Q: What language(s) do I need to learn?
A: First, since you use Java to write Android apps, learn that first without even thinking about developing for Android.  After that’s done, then you’ll learn how the Android Framework works, and what you have to do to combine the two languages in one.  It’s not easy, so take your time and most of all, have fun.

Q: Where can I go for books to learn?
A:  As with everything else, I use Amazon.com for all of my books and learning materials.  Just click here to get started.

Q: When I am ready to upload my app to the public, where do I go?
A:  Just go to http://developer.android.com.  They have all of the information you’ll need.

With these simple steps, you can be on your way to becoming an Android/Java programmer.

iOS: Considering writing iOS apps? Here’s what you need

MacComputerEver since I started writing iOS apps, I’ve seen other programmers inquire about how they can get started with writing iOS and/or Objective-C apps.

From what I could find, there isn’t a real YES or NO answers to those what seems like basic questions for inquiring minds – until now.

I will tackle the most asked questions that I could find.  If you have any others, please feel free to ask them in the comments section below.

Q: What do I need to develop iOS apps?
A: You’ll need a Mac computer.  Any recent Mac will do – even the Mac Mini.

Q: Can I develop iOS apps on a Windows computer?
A: No.  Developers must use Apple’s development environment – Xcode.

Q: How much is it to become an iOS developer?
A: $99.00 per year, which includes access to all developer’s documentation, libraries, and more.

Q: What books can I get to learn more about Objective-C programming?
A: I use Amazon.com for all of my books.  Click here to see what they have.

Q: Are their any free resources to learn Obj-C programming?
A: Yes their are.  Search Google.com to find them.

Q: Are there any online resources I can use to learn?
A: Yes.  YouTube is a fantastic resource.  I also recommend this site as well.

I hope to be expanding the above sometime soon.  Please keep those questions coming.

Obj-C: How to spell out Numbers as Text

ProgrammingMagifierYesterday, I showed you in this article on how to do basic math in Objective-C (and it could work in other languages as well).

Now today, I am going to show you a unique feature that you can put inside your apps – how to convert a standard number such as 934 and have the app convert them to letters – such as “nine hundred thirty four“.

But why would we need this?  Well, let’s say you were writing a app to write out checks.  You would need the app to print the spelled out version of an amount that a user would input in to a text field, or you’re writing an app that actually says a number to a user using speech.

For this we use a little known command called NSNumber.  We use it to format a number and then tell NSNumber how to format the number for final output to the user.

Again, this is a basic example.  For more complexed output, do a search on Google.com.

Let’s take a look at the below code:

NSNumber *value = [NSNumber numberWithInt:534];
NSNumberformatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterSpellOutStyle];
NSLog(@”Numeric: %@\nText: %@”,value,[formatter stringFromNumber:value]);
[NSNumberformatter release];

Now, let’s take a look at the code:

1.  Assign NSNumber the variable “value” and initialize it with the number 534.
2. Call the NSNumber formatter to get it ready to format the output to a user.
3.  Set the value *formatter to the NSNumberformatter command.
4.  Use the formatter value to tell the computer how to format the number.
5.  Print the result to the terminal.
6.  Release the NSNumberFormatter from memory.

That’s it.  Happy coding!

Obj-C: How to do basic math

MathTestMath has not been one of my strong points – even with the computer helping me throughout the years.  So, when I had to learn how to format a math problem using languages such as Objective-C, I was not a happy camper.

But formulating a math problem for the computer to see, figure out, and spit the answer out is easier then I thought it would be, especially for a math dunce like myself.

This article will cover the basics of how to give the computer a problem so it can give you a result.

For those of you who are using Xcode, this will be a simple program that will output the result to a NSLOG and print the answer to the console and everything will be done in the .m file.  Create a new single screen application and name it MATHTEST or something like that.

Here is the entire code.  I’ll explain what’s going on after….

    int x = 15;

    int y = 23;

    int answer = 0;

    answer = (x + y);

    NSLog(@”%d”,answer);

 Okay, let’s run down what’s going on here:

1.  We initialize the “X” variable to hold the number “15”.
2.  We initialize the “Y” variable to hold the number “23”.
3.  We initialize the “answer” variable with the value of “0”  *
4.  Let the value of answer add the
 and values (in this case, X = 15 and Y = 23).
5.  Now print the value of answer to the console (which should be 38).

That’s it….Happy coding.

Java: Displaying the current date and time in the console

JavaLogoJava can be a bear to learn – especially if you’re trying to learn two languages at the same time (such as Android and Java).  But once you get the hang of it, it’s a really good starting language to learn.

One of the first things that I learned is to display the current date and time in the console.  Even though you may not use this in the “real world”, it did help me grasp the concept of how the language worked and how to format it so the computer could read it without showing me the dreaded error messages all the time.

Here’s the code:

import java.util.*;

class GetCurrentDateAndTime
{
   public static void main(String args[])
   {
      int day, month, year;
      int second, minute, hour;
      GregorianCalendar date = new GregorianCalendar();

      day = date.get(Calendar.DAY_OF_MONTH);
      month = date.get(Calendar.MONTH);
      year = date.get(Calendar.YEAR);

      second = date.get(Calendar.SECOND);
      minute = date.get(Calendar.MINUTE);
      hour = date.get(Calendar.HOUR);

      System.out.println("Current date is  "+day+"/"+(month+1)+"/"+year);
      System.out.println("Current time is  "+hour+" : "+minute+" : "+second);
   }
}	

As you can see by the above, it is really rather simple.

1.  You have to import the java interrupter into your program so the computer can read the code.
2.  You “initialize” the variables that you’re going to be using throughout the program.
3.  The programmer tells the computer what calendar they are going to use for the day, month, and year.
4.  Assign each variable to get today’s day, month, and year
5.  Assign another set of variables to get the current second, minute and hour
6.  Finally, print the results to the screen.

That’s it….Happy coding!