[Android General] Diablo67:
Page 4:Laymen Terms Android Guides

Continued From Page 3

Page 4 Of 10

Step 1: Get Eclipse

For this tutorial, I’m going to use Eclipse, because frankly it’s the easiest and most hassle-free development tool for Android right now. If you’re a NetBeans programmer, be my guest; but we'll use Eclipse.

Download Eclipse IDE for Java Developers (PC or Mac, 92MB)

Note: This is a .zip file; when you unzip it you will be able to run it wherever you unpacked it – there is no installer. I’d recommend that you put this in “C:\Program Files\” unless you plan on making it a portable application on a USB drive.

Step 2: Download The Java JDK

If you don’t have it already, you need to download the Java JDK 6. If you currently have the JDK 5, you should be okay, but there’s really no reason not to update. Just install it by downloading and then running through the setup to get things going. I’d recommend that you just hit next–>next–>finish, rather than doing anything fancy.

Step 3: Download The Android SDK Tools

Next, you’ll need to get the Android SDK Tools straight from Google. Unpack and install this to a directory you’ll remember – you need to reference this in the next few steps.

Step 4: Configure Eclipse For Your Android

Start Eclipse, and head to ‘Help>Install New Software‘. Hit “Add…” and for the name, type “Android” and set the link to “https://dl-ssl.google.com/android/eclipse/” (if this doesn’t work, try it with http:// instead of https:// ). Click “OK” and the following should appear.

Select both of the resulting packages, and hit next – this will download the Android ADT (Android Development Tools). Go ahead and start the download to obtain these two packages. Restart Eclipse (it should prompt you to on completion of the downloads). We’re almost ready to start coding.

Step 5: Configure The Android SDK

Navigate to the folder you downloaded/unpacked the Android SDK to. In there, you’ll find a file named “SDK Setup.exe.” Start that file – the following dialogue should appear.

Don’t feel obligated to download every single thing. Could it hurt? Not really. For me, however, I only really want to program for Android 2.1 and 2.01, so those are the only API packages I bothered to get (someday I may pay for my folly, but not today). Either way, get what you want (and you do need to pick one) and hit install. The SDK manager will install it for a little while.

Step 6: Set Up Your Android Virtual Device (AVD)

Now that you’ve finished, click over to “virtual devices” (still in the SDK Manager). We’re going to create an Android device that will test run your programs for you. Hit “New” to create a new Android device, and put in the specifications that you want it to have. In the screenshot below, you’ll see the options I wanted.

Click “Create AVD” to–well–create your AVD. Select your AVD from the list, and hit “Start” to make sure that you do indeed have a working emulation of an Android phone. After a pretty lengthy start-up wait, it should look something like this.

Fool around with it and explore for a bit if you want, then close it up so we can get back to work.

Step 7: Configure Eclipse Again

Remember that Android SDK we got earlier? We didn’t do anything with it. Now, it’s time to tell Eclipse where it is so Eclipse can use it as a resource. To do this, open Eclipse and navigate to Window>Preferences (or on Mac, Eclipse>Preferences) and select the Android tab. As shown below, browse to the location of your Android SDK and hit “Apply“.

Everything check out so far? Hit “OK” to save everything and let’s go program.

Step 8: Create A New Project

It’s finally time to code some. Navigate to ‘File>New>Other…>Android>Android Project‘, and input a project name, as well as some other details. If you want, copy from my screenshot below. Some of the fields need explaining that simply doesn’t belong here, so if you want to know more specifically, please let me know and maybe I’ll write an article about it.

Hit “Finish” and the project will be created.

Step 9: Input Your Code

In the tree on the left, navigate to the “src” folder and expand everything. Go to the file with the name of your “Activity” (created in step 8, mine was HelloWorld) and double click it to see the contents. Presently, your code has all of the content in black (with some minor modifications depending on your settings). To make a working “Hello world” program, you need to add the text that is in bold red. Note that there are two bold red “blocks” of code, and you need to add both to make things work.

//==========Start Code============

package com.android.helloandroid;

import android.app.Activity;

import android.os.Bundle;

import android.widget.TextView;

public class HelloAndroid extends Activity {

/** Called when the activity is first created. */

[MENTION=439709]override[/MENTION]

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

TextView tv = new TextView(this);

tv.setText("Hello, Android");

setContentView(tv);

}

}

//==========End Code============

The point of this tutorial is to get your feet off the ground. I know some or most of this is confusing; but it’s just how things are wired.

Step 10: Run Your Program

Above your code, you’ll see a little green “Play” button (or navigate to ‘Run>Run‘). Click it.When a popup box asks you how to run the application, you’re going to tell it to run as an “Android Application”. It will prompt you to save changes; hit yes.

Now you get to wait an eternity while your virtual device boots up. I’d recommend that you leave it open for the duration of your programming sprees, otherwise you’re going to spend more time watching the Android logo spin than you will watching your program freeze up. Just saying. Efficiency.

After everything’s done loading, your application should upload and start automatically. Which means that right after you “unlock” the device, you’ll be greeted with your first Android program.I only captured the top half of the screen because the rest of it is black.

Source: Coding project

Android 4.0(ICS): The Ultimate Guide

Home screen and system navigation

As with past versions of Android, the heart of Ice Cream Sandwich lies in its home screen; it's the main way you'll get around and get things done. If you've used Android before, the first thing you'll notice is how different the home screen looks in the 4.0-level release: With Ice Cream Sandwich, Google phased in a completely new graphic design, revolving around a blue-and-gray "holographic" interface and a custom font called Roboto.

Appearances aside, some things work a little differently in ICS than they have in the past. Follow along for a guided tour of the Android 4.0 home screen.

Status/Notification bar: The status bar always sits along the top of your phone's screen. On its right, you'll see the current time along with your battery level and data connection status; on its left, you'll see alerts and notifications, which have gotten a serious boost in Android 4.0.

Search bar: Android 4.0 features a Google search bar at the top of every home screen panel. You can tap here and begin typing a search term, or tap the Voice Actions icon on the right to initiate a voice search or perform other voice commands.

Home screen: You can fill this area with any combination of app shortcuts, folders and live, dynamic widgets (more on those in a bit). Android 4.0 gives you five home screen panels; just swipe left or right to move to the next or previous panel and access whatever you've stored there.

Favorites tray: The Favorites tray is like a dock for your home screen: The shortcuts or folders placed there stay present as you swipe from one panel to the next. By default, the tray includes commonly used items such as your Phone app, People app, Messaging app and Browser, with an icon for launching your app drawer in the center -- but you can customize it to include any items you want.

Navigation buttons: Instead of relying on a phone's physical buttons as in previous versions of Android, ICS has three main navigation buttons built into the interface at the bottom of the screen:

The Back button, which looks like a left-facing arrow, takes you back one step from wherever you are.

The Home button, which looks vaguely like a house, returns you to your home screen.

The Recent Apps button -- a new addition to Android 4.0 -- allows you to multitask and switch among recently used applications. You can tap the button from anywhere in the system to get a list of recently used apps, then tap on any app to jump directly to that program. You can also swipe left or right on any app to dismiss it and remove it from the list.

If you've used Android before, you might be wondering what happened to the Menu button. As of Android 4.0, the Menu button is a thing of the past: All options and commands now appear on-screen instead of being hidden away like they were with previous-generation devices.

If an application has more options than can fit on the screen, you'll see an icon that looks like three vertical dots; tapping that icon will bring up a list of additional functions relevant to your current activity.

(Curiously enough, the location of the vertical-dots icon is not always consistent, which was one of my criticisms of ICS in my initial review of the software.)

If your phone has hardware buttons: It's worth noting that while Google's Android 4.0 design guidelines call for virtual on-screen buttons, some phones still use hardware buttons instead -- either because they're older devices that have been upgraded or newer phones whose manufacturers have opted to stick with the older-style setup. If you're using an Android device that has physical buttons, those buttons should more or less correspond with the same functions described above.

A couple of exceptions: If your phone has a physical Menu button, some options in applications will remain hidden behind that button, as they have in the past. You can press the Menu button in various applications to see what additional options are available to you.

If your phone has a physical Home button but no Recent Apps button, meanwhile, you can access the app-switching function by pressing the Home button and holding it down for a few seconds.

Android 4.0 notifications

Notifications have always been a strength of Android, and with Android 4.0, they become more powerful than ever. Notifications appear on the left side of the status bar at the top of your phone's screen. The icons you see here indicate everything from new email and text messages to missed calls and calendar appointments.

To view your notifications in detail, touch your finger to the Notification bar and swipe downward. A panel will pull down over your screen showing you all of your pending notifications; you can tap on any notification to view more information about it or swipe your finger left or right on it to dismiss it from the list. You can also tap the "X" at the top-right of the notification area to dismiss and remove all of your pending notifications.

The type of notifications you get depends on what apps and accounts you have configured on your phone. With any app that's capable of sending notifications, you can customize what events trigger notifications or even disable notifications altogether; just look in the settings of each individual app to find those options.

The type of notifications you get depends on what apps and accounts you have configured on your phone. With any app that's capable of sending notifications, you can customize what events trigger notifications or even disable notifications altogether; just look in the settings of each individual app to find those options.

You can customize or disable notifications within the settings of individual apps. Click to view larger image.

In Gmail, for example, you can tap on the vertical-dots icon at the bottom of the screen (or press the Menu button, if you're on an older phone) to access the app's settings.

Within the Settings menu, tap on the line representing your Gmail account -- if you have more than one Gmail account configured, you can control notifications separately for each one -- and then check or uncheck "Email notifications" to enable or disable notifications for that account. You can also configure whether a sound and/or vibration will accompany each new mail notification.

Similar controls exist in other notification-capable apps, including the Messaging app (for text messages), Google Voice, Google+, Facebook and most Twitter clients.

In addition to basic activity-based alerts, the notifications area can display active controls for certain types of apps, such as the Android Play Music app; when you're playing a song in that app, pulling down the notification panel will reveal a set of interactive playback controls that allow you to pause, play or stop the music, or navigate through the album's tracks.

Apps in Android 4.0

If the home screen is the heart of Android, the apps are the blood that pump through its veins. Much of the Android experience revolves around applications, whether they're basic system apps like the Phone and Browser apps or third-party apps like Dropbox, Flipboard and Google Reader.

If you've used an earlier version of Android, you'll find that installing apps works the same way in ICS, so you can skip directly to "Accessing and organizing apps" below.

Finding and installing apps

You can access the Google Play Store directly from your phone or from any PC. Click to view larger image.

Android allows you to install apps from any source you wish. That said, most people use the Google Play Store to get new applications; it's the official Android market for apps (formerly known as the Android Market, fittingly enough) and the simplest and most direct way to get new programs onto your phone.

You can access the Google Play Store directly from your phone, via the Play Store icon (it looks like a shopping bag); you can also access it online from any PC by going to play.google.com. Whichever interface you use, just follow the tab for Android apps to browse through categories of popular and recommended applications. You can also use the Play Store's search function if you're looking for a particular title or type of application.

When you find an app you want, touch the Download or Install button to put it onto your phone. If you're using the Play Store website, the app will be sent wirelessly to your device. If you have multiple Android devices connected to your Google account -- a phone and a tablet, for example -- the website will prompt you to select the device you want to use via a drop-down menu.

If you see a price in place of the Download or Install button, that means the app isn't free; tap the button with the price if you want to buy it, and the cost will be charged to whatever credit card you have connected to your Google account. (The Play Store prompts you to set up a payment method the first time you connect or attempt to purchase an application.)

Accessing and organizing apps

The Android 4.0 app drawer houses all of your phone's apps and widgets. Click to view larger image.

You can always access all of your applications by tapping your phone's Apps icon -- the circled cluster of dots located in your Favorites tray at the bottom-center of your home screen.

This opens up your All Apps area, commonly called the app drawer, which contains a complete list of apps installed on your phone; swipe left or right to scroll through the list, and touch any app to open it.

If you want easy access to an app, you can add it as a shortcut on your home screen. Just press and hold the icon in your app drawer, then use your finger to drag it around until it's in a place you like. You can move the shortcut between home screen panels by sliding your finger to the very left- or rightmost edge of the current panel -- and if you decide you want to move a shortcut somewhere else later, all you have to do is press and hold the icon on your home screen to pick it up and relocate it. To remove a shortcut from your home screen, press and hold it, then drag it to the Remove icon that appears at the top of the screen.

Want to completely uninstall an app from your phone? Easy: All you have to do is press and hold it in the app drawer, then drag it to the Uninstall icon that shows up at the top of the screen. You'll also see an App Info icon; dragging the app there will allow you to view detailed info about the program's usage and permissions as well as clear its cache or data storage.

Android 4.0 makes it easy for you to create folders on your home screen that contain apps, in case you want to group similar items together to save on space or make things more tidy. While previous versions of Android had folders, they're easier to manage in 4.0, and their appearance has a sleek new look as well.

To create a folder in ICS, all you do is drop one icon on top of another on your home screen. You can add more items into the folder the same way.

Once a folder's been created, you can tap the folder to open it and show all the apps within; you can remove any item from the folder by touching it and dragging it out. You can name the folder, too: Just touch your finger to the text that says "Unnamed Folder" and type in any name you want.

Finally, you can place any items you want in the Favorites tray below the home-screen panels so they'll always be handy: Just touch and hold any icon that's already in the tray to move it out, and touch and drag any other icon in to replace it. You can even create folders within the tray, if you're so inclined.

Working with widgets

We can't talk about Android apps without talking about widgets. Widgets are one of the most powerful features Android provides; they essentially give you live, functioning programs right on your phone's home screen. Widgets let you do things like scroll through your inbox or your calendar, flip through current forecasts for multiple cities, and adjust your phone's basic settings without ever having to open a program or leave the home screen.

Widgets are frequently included as components of applications. For example, if you download the Pandora app, you'll also get the Pandora widget, which you can put on your home screen (or not) as you like. Some developers also offer standalone widget downloads, like the popular Beautiful Widgets and HD Widgets collections.

You can see a list of widgets on your device by touching the Widgets tab at the top of the app drawer and swiping left or right through the list. Placing a widget on your home screen is no different than placing an app shortcut: You press and hold the widget you want, then drag it wherever you wish on your home screen.

With Android 4.0, many widgets can be resized, too: Just press and hold any widget on your home screen, and if it's resizable, you'll see a blue box appear around it. Drag an edge of the box up, down, left or right to make the widget larger or smaller.

Want more widgets? Head to the Google Play Store; there's an entire section there devoted to apps with widgets, and you can always try searching, too.

Android 4.0 settings

Almost everything in Android can be customized, and Android 4.0 introduces a completely revamped settings area with a streamlined interface and numerous new options.

The simplest way to get to your phone's settings is to pull down the notification panel and then touch the icon directly next to the date (it looks like a series of sliding controls). Alternatively, you can find the Settings app within your app drawer; you can even put the shortcut directly on your home screen if you want.

Many of the items in the Android 4.0 settings area are self-explanatory. A few things are worth pointing out, though:

The Data Usage feature is a new and noteworthy addition to Android 4.0. It allows you to view your mobile data usage and see exactly how many bytes each application and process is utilizing.

It also lets you set a monthly mobile data limit; once set, the system will cut off all non-Wi-Fi data transfers above the limit to ensure you don't exceed your carrier's monthly data cap. You can set limits on background data transfers for specific apps, too, if you want to restrict activity for particularly data-hungry programs.

The Battery feature is another Android 4.0 addition that's well worth exploring. It allows you to get a grasp on your phone's power usage by seeing exactly how much of your battery charge is being consumed by each app and process during the day.

The Apps section of the settings shows you a complete list of all apps on your phone, including those you have installed and any that came preloaded on the device (touch the All tab to view preloaded applications). You can opt to disable any preinstalled app from here, which effectively hides it from the system and gets it out of your way.

This is useful for carrier-installed bloatware, which is often baked into the phone and impossible to uninstall. Just be careful in deciding what to disable, as disabling an important system process could have unintended consequences. As a general rule, if you aren't sure what something is, it's probably best to leave it alone.

The Accounts & Sync section shows you every account connected to your phone -- Google accounts, third-party email accounts and service-based accounts for apps like Dropbox or Facebook -- and allows you to change the autosync settings for each account as well. You can add new accounts and delete old ones from this area, too, which can be useful if you change email providers at some point or decide to add another inbox into the mix.

The Security section is an area you'll definitely want to visit. It houses the commands to set up a PIN, password or pattern lock for your phone. (Android 4.0 has a face-recognition unlock feature, too, but -- while incredibly novel -- it's far less secure than the more traditional methods.) The section also enables you to encrypt your phone's data and require a PIN or password to decrypt it every time the device is powered on.

As far as your data goes, Google can automatically back up your basic phone settings as well as your installed applications; if you should ever move to a new device, your settings and applications can then automatically be restored. Just make sure you have the "Back up my data" and "Automatic restore" options checked in the Backup & Reset section of your phone's settings if you want this feature to work.

Continued On Page 5...