Configuring the Android Emulator for GTalk

Before you can begin coding this project, you need to adjust a development setting on the Android Emulator, XMPP Settings.

With the project open, you need to depart from your routine for a minute. If you are familiar with GTalk, you are aware that you can use the product only when you log into your Google account. Therefore, you must take an extra step now to ensure that your device (in this case, the Android Emulator) can log into your Google account, thus enabling you to send and receive messages.

Navigate to your AndroidSDK/tools folder and launch the Emulator. You could launch it from within the Eclipse development environment, but that would require you to also launch an Activity that you have not coded yet. To save some time, just launch the Emulator manually.

After the Emulator is open, click the All shortcut. Find the Dev Tools item and launch it. You should see a menu similar to that shown in the following illustration.

Development Settings

Exception Browser

Instrumentation

Media Scanner

Package Browser

Pointer Location

1

2

3

4

5

e

7

S

9

0

Q

W

E

R

T

Y

U

I

0

P

A

S

0

F

G

H

J

K

L

Ofl til

4

z

X

C

V

B

N

M

*->

IVĀ«

@

LJ

/

Scroll through the Dev Tools menu until you find XMPP Settings. Select XMPP Settings and you should see the Activity shown in the following illustration.

NOTE

When you open XMPP Settings, the Activity name is GTalk Settings. This may be an indication of where Google is going with the remaining packages of the Google API. The noticeable disconnect in the naming may be a leftover from the changes that were made between SDK versions.

The Activity should read Account:<None>, as the illustration shows. This indicates that there is not login information stored for your device. You need to add the login information for your Google account to allow your Activity access to Google's servers.

Click Add Account to display a screen, similar to the following, that you add your information to.

After you input your Username and Password, click Sign In. The Android Emulator should now attempt to authenticate your information. While the Emulator attempts to authenticate your information, it shows an "Authenticating" message.

CAUTION

Depending on your connection and whether or not you have a debugger connected to your Emulator, you may see this "Authenticating" message for a while. If your account is not authenticated after a few minutes, restart your Emulator and try again.

Once your information is authenticated, you should see the screen shown in the following illustration. Notice that there is no Return button here; just click the Home key on the Emulator to return to the main screen.

Now that the Emulator is configured and the project is set up, you can begin to code your Activity.

0 0

Post a comment