Wednesday, August 24, 2011

Android Programming - 19-20 Sep 2011

Come and join us in the upcoming Android Programming course on 19-20 Sep 2011. In this 2-day course, you will learn how to get jumpstarted with Android programming using Eclipse and the Android SDK in the shortest amount of time. This is a lab-intensive course that will have you up and running in just one morning! By the end of the day, you will be able to write your own Android apps and be like these guys.

Register today and every participant get a copy of my Beginning Android Application Development book!

Sample Project by Android Course Participant - Converts between degrees of Latitude and Longitude and MGRS

In last week's Android class at Fort Gordon, I have an outstanding participant - Chiam Krause, who took some jar files from the World Wind JAVA SDK and put together a coordinate converter that converts between degrees of Latitude and Longitude and MGRS. He has kindly shared the source code of his project on bitbucket. The project name is GridSquare.

Check out his blog here. Thanks, Chiam!

Monday, August 22, 2011

Army moves to create mobile apps in pilot course

An increase in the commercial use of Smartphone technologies is rapidly finding its way into the military. For the past two years, the U. S. Army Training and Doctrine Command has pursued a concept exploration pilot program called Connecting Soldiers to Digital Applications. In the consumer market, the proliferation of phones and accessibility for developers to write and distribute powerful apps has created an environment that has challenged traditional software acquisition strategies. The reduced requirements for developers have empowered scores of programmers to learn to write apps.

The Army, through CSDA, is working toward creating mechanisms that will allow organizations to write their own apps for distribution through a future Army Marketplace. Part of the CSDA process is teaching government civilians and members of active duty and reserves the foundations of writing mobile apps. The U. S. Army Signal Center of Excellence established a Mobile Applications Branch at Fort Gordon, Ga., with a task to develop apps and host training opportunities for app development.

From 8-19 August, Fort Gordon hosted an Android class in Cobb Hall, which consisted of 38 students from TRADOC, quite a few came from other organizations within the Army and other services, who wrote their first Android apps within the course.

Read more here.

Saturday, August 20, 2011

Another Android app published by my course participants - Android Programming - US Aug 2011

Here is another app published by one of my Android Programming course participants (US Aug 2011).

Need help with figuring out fiber optic color code?
This is the app for you.

- Features
* Show colors and # from fiber optic pair count.
* Show pair colors, binder colors, and 600 binder color from a pair count using 25 pair color code.

Thursday, August 18, 2011

Android apps in the Android Market from participants of my Android class in the US - Aug 2011

This week I am in the US conducting my Android Programming class. And I am very proud to list the apps that some of my course participants have created in the short time span of a couple of days. Check out these apps in the Android Market. More will be listed as soon as they are available on the Android Market. This is way cool, guys!

Simple Tip Calculator that lets you choose the level of service that you had and it tells you how much of a tip you should leave based on the dollar amount of your ticket.









Protect Lives and Property within the Cove Acres calling area. Assist other Fire Districts as needed and requested.










A simple currency converter application to give you real-time currency exchange information for 80+ international currencies.

Internet/data connection is needed in order to obtain real-time rate.


Saturday, August 13, 2011

iOS Tutorial - Importing & Exporting Documents in iOS

One of the common tasks that an iOS developer has to do is to import or export documents from his iOS application. For example, suppose you are developing a document reader and you want to allow the user to import documents into your application so that it can be read offline. Also, your reader might also support the exporting of documents so that other applications can make use of the document.

In this article, I will walk you through the different techniques you can employ to allow documents to be imported or exported from your iOS application.



Friday, July 29, 2011

Schedule for iOS Programming Course and Android Programming Course in Sep and Oct 2011 (Singapore)

Quite a number of readers have asked about the schedule of iOS Programming Course and Android Programming Course (Singapore) in Sep and Oct, so here it is!

September 2011
* 12 Sep 2011 - Objective-C Programming - S$499
* 13-14 Sep 2011 - Foundation of iPhone Programming - S$997
* 15-16 Sep 2011 - Advanced iOS Programming - S$997
* 19-20 Sep 2011 - Android Programming - S$997
* 22-23 Sep 2011 - Programming iOS 5 - S$997

October 2011
* 3 Oct 2011 - Objective-C Programming - S$499
* 4-5 Oct 2011 - Foundation of iPhone Programming - S$997
* 6-7 Oct 2011 - Programming iOS 5 - S$997

Details
All courses will be held at Mountbatten Square, Singapore.
Attendees have to bring their own notebook computers
Training time: 9am to 5pm.
For enquiries, please call (65) 9-692-4065.

* Also, all iOS courses are now fully updated to cover Xcode 4.
* And as soon as iOS 5 is officially released, all iOS courses would be based on iOS 5.

You can download the course brochures and application form here.
Please scan a copy of the completed registration form and email it to weimenglee@learn2develop.net.

Wednesday, July 27, 2011

Beginning Android Application Development now rank #1 in Amazon.com's Software Development category

My Beginning Android Application Development book is now ranked #1 in Amazon.com's Software Development category!

If you want to jumpstart your Android development effort, check out my book!

Thanks everyone for the support!

iOS Chat Application using Bonjour

A number of readers have asked where can they find the Bonjour Chat application that was mentioned in my Beginning iOS 4 Application Development book by Wrox. It is part of the code download for the book. To download the source code, head over to here. Go to the Chapter for Bonjour and the project contains all the code for Bonjour chatting! Enjoy!

Tuesday, July 26, 2011

Android Article - Preserving User Preferences in Android Applications

Often you need to store personalized information for each user of your application. For example, your application may require users to logon to a secure server for authentication. In this case, the user needs to supply his credentials, such as a login name and a password. The first time the user uses your application this information will be entered by the user, but subsequently it would be useful for your application to “remember” this information somewhere so that it can save the user the trouble of entering the same information every time he uses your application. To save this information, there are a couple of ways you could use – files, databases, etc. However, a much better way would be to use the SharedPreferences feature in Android. In this article, I will walk you through the steps to creating an Android application that makes use of this SharedPreferences feature.

Sunday, July 24, 2011

Foundation of iPhone Programming - 21-22 July 2011

Here is another fun iPhone programming course that I had conducted last week. As usual, after the class I think I have converted a few people to buy their first Mac in their life. :-)

And what a time to run the course, Apple just released Lion and a slew of new machines....Mac Mini and MacBook air.....

Friday, July 08, 2011

Objective-C Memory Management Tip 1 - Remember to retain item(s) retrieved from an array

Very often in Objective-C, you have an array that contains a number of objects, like this:

NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:@"Item 1"];
[array addObject:@"Item 2"];
[array addObject:@"Item 3"];

And often, you need to retrieve an object from the array and then assign it to another object, like this:
NSString *item = [array objectAtIndex:1];
However, the statement above is not safe as the object can be removed any time, like this:

NSString *item = [array objectAtIndex:1];
[array removeObjectAtIndex:1];

In this case, the item is no longer pointing to a valid memory location. You should instead use a retain on the object that is assigned to the object from the array:

NSString *item = [[array objectAtIndex:1] retain];
[array removeObjectAtIndex:1];
Doing so will ensure that even if the object in the array is removed, the object pointing to it will still remain valid.

In short, remember to retain item(s) retrieved from an array.

Tuesday, July 05, 2011

Learning Objective-C Programming (Singapore) - 19 July 2011

One of the hurdles that most developers encounter when starting out on iOS development is the language - Objective-C. While Objective-C is an extension of the C Programming language, its syntax left most of the developers who are deeply entrenched in Java and C# very confused. In addition, Objective-C in iOS requires developers to manage their own memory usage carefully so that memory is utilized efficiently. In fact, a little mistake in deallocating objects in Objective-C is enough to make your application spiralling out of control. It is with this intention that I am launching this new course on Objective-C programming.

In this one-day course, I will show you how to get started in Objective-C programming the easy way. Through this lab-intensive course, you will learn:

1. The basic syntax for calling properties and methods
2. How to declare and implement a class, its methods, and properties
3. Access Privileges
4. Initializers
5. How protocols and delegates work
6. The common classes used in Objective-C
7. The 101s of memory management for Objective-C in Cocoa/Cocoa Touch
8. And more!

If you are just getting started with iOS programming, this course is a must-have to ensure that you will become productive in the shortest amount of time.

Note that this is not an introductory class on programming. Attendees are expected to have some experience in programming using languages such as Visual Basic, C, C++, Java, or C#.

Venue: Mountbatten Square (Singapore)
Date: 19 July 2011 (Tue)
Time: 9am to 5pm
Fee: S$499 (nett)

Alumni for the iOS courses (Foundation of iPhone Programming and Advanced iOS Programming courses) will get a S$100 discount.

Monday, July 04, 2011

My new eBook published - Building Applications for the Mac App Store

My new eBook has just been released at Wrox.com - "Building Applications for the Mac App Store". Here is a brief synopsis of the book:

In this Wrox Blox, you will learn how to obtain and access the Mac App Store from your Mac. You will also learn about the opportunities available for developers who want to venture into the Mac market. This Wrox Blox also walks you through the steps you need to perform to publish your apps in the Mac App Store. You will use the Xcode 4 development tool provided by Apple to develop a Mac OS X application, and then see how it can be published in the Mac App Store.

Sunday, July 03, 2011

Inaugural weekend iPhone class - 2-3 July 2011

The first iPhone weekend class was a great success. :-) I had a lot of fun running the class and boy, we had an aspiring 9-year old iPhone developer!

iPhone and Android course for July 2011 (Singapore)

Here is the schedule for iPhone and Android courses (Singapore) for the month of July 2011:

* Foundation of iPhone Programming - 21-22 July 2011 (Thu-Fri)
* Android Programming - 25-26 July 2011 (Mon-Tue)

As seats are limited, do enrol soon to avoid disappointment! Download the application form here.

Monday, June 27, 2011

iOS and Android World Tour coming to Atlanta in Sep 2011

I am very honoured to announce that with collaboration with Agilitrain, my iOS and Android World Tour is coming to Atlanta this Sep 2011! Click on the links below to register for the courses!

Wednesday, June 22, 2011

iOS and Android World Tour coming to Vancouver in Oct 2011

My iOS and Android World Tour continues to Vancouver, Canada in Oct 2011! Here is the schedule:

1. Foundation of iPhone Programming - 10-11 Oct 2011 (Mon-Tue)
2. Advanced iOS Programming - 12-13 Oct 2011 (Wed-Thur)
3. Android Programming - 14-15 Oct 2011 (Fri-Sat)

More details coming your way, but reserve the dates if you want to get in the iOS and Android bandwagon!

Tuesday, June 14, 2011

Bluetooth Tennis Ball Example (DevTeach) available for download



I have made the source code for the Bluetooth Tennis ball example that I have demonstrated at DevTeach available for download. To run the example, you need a Mac with the iOS SDK installed. Enjoy!

Thursday, June 09, 2011

Weekend Class - Foundation of iPhone Programming - 2-3 July 2011

There will be a special run of the Foundation of iPhone Programming (S$997 nett) on the weekend of 2-3 July 2011 (9am to 5pm). Venue is Mountbatten Square. Lunch provided.

Register now to avoid disappointment!

Last call for iOS and Android courses in June 2011

This is the final call for all participants interested in enrolling for the iOS and Android courses in June 2011.

As spaces are limited, do register quickly to avoid disappointment. Download course brochures and application form here.

Friday, May 27, 2011

Mobile Programming Courses in June 2011 - iPhone, Android, and Windows Phone 7

Here are the courses running in June 2011. If you have not registered for them yet, do so now as seats are running out.

Download course outlines and application form here.

Wednesday, May 25, 2011

Learn iOS Bluetooth Programming at DevTeach 2011

Join me in my talk at DevTeach and I will show you how to program your iOS devices to talk to each other using Bluetooth. Click the video above to see a simple example that I have developed to demonstrate the kind of things you can do with Bluetooth. See you at DevTeach!

Come and join me in my talks at DevTeach - May 30 - June 3 2011

I will be presenting 2 sessions at DevTeach 2011 (Canada). The 2 sessions are:

Building Location-Aware iOS Application
In this session, you will learn how to use the Location Manager to obtain geographical data in your iOS application. You will learn how to implement a location tracker application that allows you to log your movements, as well as how to use Google Maps to display your current location. Last but not least, you will learn some of the new location features available in the iOS SDK.

Developing Bluetooth iOS Applications
In this session, you will learn how to use the GameKit framework in the iOS SDK to develop compelling iOS applications. You will learn how to write a simple chat application that allows two iOS users to communicate. In addition, you will also learn how to use the Voice Chat feature in the GameKit to transfer voice data between two devices.

Hope to see you at DevTeach!

San Francisco - Android and iPhone Bootcamp

I will be in San Francisco from 4 to 7 June 2011. If you are looking for Android or iOS Bootcamp training during this period, give me a buzz.

Friday, May 20, 2011

Weekend class - Foundation of iPhone Programming - 28-29 May 2011

There will be a special run of the Foundation of iPhone Programming (S$997 nett) next weekend - 28-29 May 2011 (9am to 5pm). Venue is Mountbatten Square. Lunch provided.

Register now to avoid disappointment!

iOS Bluetooth Programming - Getting devices to see each other

Sometime back, I wrote an article for DevX.com on how to write Bluetooth iPhone applications. In that article, iOS devices running that program will be able to see each other when you use the GKPeerPickerController class to look for each other. So why is it that your application can only see another device running the same application, and not other Bluetooth applications running on the same device?

The reason is simple. When you use the GKPeerPickerController class to look for other Bluetooth devices, it creates a session ID. Applications will only be able to see each other if the session IDs are identical. By default, the session ID is the application's Bundle Identifier (you can see this in the Info.plist file in your Xcode project. Hence, if an application is installed on two devices, one should be able to see the other since they have the same Bundle Identifier. By default, the bundle identifier is set to: com.yourcompany.${PRODUCT_NAME:rfc1034identifier}. So if two applications have different Product Name they won't be able to see each other.

But what if you want to customize the session ID by creating your own? To do so, you just need to implement the following method:
- (GKSession *)peerPickerController:(GKPeerPickerController *)picker
sessionForConnectionType:(GKPeerPickerConnectionType)type {
if (!self.currentSession) {
self.currentSession = [[[GKSession alloc] initWithSessionID:@"Session_ID_Here" displayName:nil sessionMode:GKSessionModePeer] autorelease];
self.currentSession.delegate = self;
}
return self.currentSession;
}
In this case, devices can only see each other if their session ID are the same. The displayName argument allows you to specify the name of the device that will be seen by the other party. If you set it to nil, iOS will use the device's name.

Wednesday, May 18, 2011

Coming soon - Beginning Android Tablet Application Development (Wrox)

If you are fascinated with the many Android tablets in the market and wanted to write an application or two for these devices, check out my latest book that is coming your way soon in August. This book is geared towards those beginning developers who wanted to start writing Android tablet apps first. This book will get you started in no time.

Once you are up to speed, head over to the Beginning Android Application Development for the full gutsy gory details of Android programming.

How to change the Base SDK of your iOS Project

In the past, when you create your iOS project, Xcode will always hardcode the version number of the SDK in your project.

If you open the project using a newer version of the SDK, you will get the Base SDK Missing error:

image001

To resolve this, simply double-click on the project name (in this example, BasicUI) to open the Info window. In the Info window, select the General tab:

image002

At the bottom of the Info window, select the drop down for Base SDK for All Configurations and select Latest iOS (iOS 4.3). Once this is selected, close the Info window.

Back in Xcode, you should see the SDK number that was selected earlier:

image003

If you don’t see this, close the project and reopen it again. This time, the updated version number should appear.

Friday, May 13, 2011

Android Tip - How to intercept SMS messages and prevent them from appearing in the Messaging App?

Sometime back, I wrote an article on how to intercept incoming SMS messages in your Android application - http://mobiforge.com/developing/story/sms-messaging-android.

Ever since, I have received numerous questions on how you can prevent the incoming messages (that you are trying to intercept) from appearing in the Messaging application (and hence in the status bar). The solution to this is pretty straight-forward once you understand the concept of broadcast receivers.

Basically, your program registers a class SMSReceiver as a broadcast receiver to intercept incoming SMS messages:
       <receiver android:name=".SMSReceiver">
         <intent-filter>
             <action android:name="android.provider.Telephony.SMS_RECEIVED" />                  
         </intent-filter>
     </receiver>

When a SMS message is received, all applications (including the Messaging application) will take turn to handle the incoming message. So, in order to prevent the incoming message from being handled by the Messaging application, your application just needs to handle the message before the Messaging app has the chance to do so. To do this, add the android:priority attribute to the <intent-filter> element, like this:
        <receiver android:name=".SMSReceiver">
         <intent-filter android:priority="100">
             <action android:name="android.provider.Telephony.SMS_RECEIVED" />                  
         </intent-filter>
     </receiver>
Set this to a high number, such as 100. The higher the number, the earlier Android executes your application. So in this case, when an incoming message is received, your application will execute first, and you can decide what to do with the message. To prevent other applications from seeing the message, simply call the abortBroadcast() method in your broadcast receiver class (SMSReceiver):
        this.abortBroadcast();
Once you do this, no other applications will see your SMS message. :-) Have fun!