Monday, November 30, 2009

Announcing the Winners of ADC 2

Back in May at Google I/O, we announced ADC 2 -- the second Android Developer Challenge -- to encourage the development of cool apps that delight mobile users. We received many interesting and high-quality applications -- everything from exciting arcade games to nifty productivity utilities. We also saw apps that took advantage of openness of Android to enhance system behavior at a deep level to provide users with a greater degree of customization and utility. We were particularly pleased to see submissions from many smaller and independent developers.

Over the last couple of months, tens of thousands of Android users around the world reviewed and scored these applications. There were many great apps and the scores were very close. Together with our official panel of judges, these users have spoken and selected our winners!

I am pleased to present the ADC 2 winners gallery, which includes not only the top winners overall and in each category, but also all of the applications that made it to the top 200. There are a lot of great applications in addition to the top winners.

Thanks to everyone who submitted applications or helped us judge the entrants. We encourage all developers to submit their applications to Android Market where their app can be downloaded and enjoyed by Android users around the world.

Sunday, November 29, 2009

Android Hello World Activity Sample

Here we are looking how to create a sample hello android program using eclipse IDE
1.Setup your Environment
2. Create an application

1. Setup Android Environment
a. Download latest Eclipse from http://eclipse.org/
b. update android Plug-in - Refer : http://about-android.blogspot.com/2009/11/about-android-first-of-all-android_09.html


c. Install Android SDK
Install new android SDK from the android site. Refer:http://about-android.blogspot.com/2009/11/about-android-first-of-all-android_09.html


D. Configure SDK with your Eclipse
Go to Window>Preference>Select Android > Browse "SDK PATH" > Apply


E. Create a Device / Emulator
Create emulator using the AVD manager
Open AVD Manager > New > Give Name/Target > Create AVD.


Android Environment has setted. Now we can create an android Application.

2. Create a " Hello World Apps "
a. Open Eclipse > File > Android Project.


b. Check the Android Folder Structure.
Go to Window > Show View > package Explorer


AndroidManifest.xml - It contains the overall application configuration.
src - Contains the java code like activites,service,broadcast receiver , etc,.
res - Contains the application resource
          1. drawable - Icon,Image
          2. raw - Sounds
          3. menu - menu properties
          4. values - application properites like title,color value, dropdown values.
          5. layout - screen design
gen - Contains the R.java File which is used to map the resource and java src.

c. Run the application
Run > Run Android Application

 

 D. Check the Emulator


Hope this is useful for create a hello world program.

Tuesday, November 24, 2009

ADC 2 Public Judging is now closed

Thanks to tens of thousands of Android users around the world who participated in the review of ADC 2 finalist applications, we have now collected sufficient scores to complete Round 2 of public judging.

We are reviewing the final results and will announce the top winners this coming Monday, November 30. Thanks to all who've participated in ADC 2 and good luck to all the finalists.

Saturday, November 21, 2009

Application Fundamentals

Android applications are written in the Java programming language.
Android application archieve format is .apx
Each process has its own Java virtual machine (VM), so application code runs in isolation from the code of all other application
Android Application Components are Activites,Service,Broadcast receivers and Content providers

Activities
An application that has a visible UI is implemented with an activity. When a user selects an application from the home screen or application launcher, an activity is started.

Services
A service should be used for any application that needs to persist for a long time, such as a network monitor or update-checking application.

Content providers
You can think of content providers as a database server. A content provider's job is to manage access to persisted data, such as a SQLite database. If your application is very simple, you might not necessarily create a content provider. If you're building a larger application, or one that makes data available to multiple activities or applications, a content provider is the means of accessing your data.

Broadcast receivers
An Android application may be launched to process a element of data or respond to an event, such as the receipt of a text message.

AndroidManifest.xml - Configuration
An Android application, along with a file called AndroidManifest.xml, is deployed to a device.
AndroidManifest.xml contains the necessary configuration information to properly install it to the device. It includes the required class names and types of events the application is able to process, and the required permissions the application needs to run.

Project Folder Structure ;
1. src - It contain the java code
2. Resource - It contain the all resource with different floder
    drawable - Icon
    raw - Sounds
    menu - Menu
    values - Project Properties
    layout - User interface Screens
3. gen - It contains the R.java file. You could not edit R.java manually. This have been generated automatically by understanding resource files etc.
4. AndroidManifest -It contains the Project properties
5. Android lib.


The next topic discusses the "Hello Android" Program and layout.

Friday, November 20, 2009

Architecture of Android

Architecture of Android :
1. Linux Kernal [ 2.6 Kernal - security, memory management, process management, network stack, and driver model]
2. Native Libraries [SQLite, WEBKit, OpenGL,..]
3. Runtime + Dalvik VM [.dex format, Lightweight VM, Efficient Dalvik Bytecode]
4. Application Framework [Activity Manager, Content Manager, Location Manager, ]
5. Application [ System Apps and Your Apps]


Linux Kernal
Android is based on the linux keral 2.6. From the Kernal 2.6 android using the hardward interaction layer
Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

Libraries
Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework.

Android Runtime
Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.

Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool.

The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.



Application Framework

Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework). This same mechanism allows components to be replaced by the user.

Underlying all applications is a set of services and systems, including:

* A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser
* Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data
* A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files
* A Notification Manager that enables all applications to display custom alerts in the status bar
* An Activity Manager that manages the lifecycle of applications and provides a common navigation backstack



Applications

Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.

The next topic discusses the basic components and folder structure of android application.

Wednesday, November 11, 2009

Integrating Application with Intents

Written in collaboration with Michael Burton, Mob.ly; Ivan Mitrovic, uLocate; and Josh Garnier, OpenTable.

OpenTable, uLocate, and Mob.ly worked together to create a great user experience on Android. We saw an opportunity to enable WHERE and GoodFood users to make reservations on OpenTable easily and seamlessly. This is a situation where everyone wins — OpenTable gets more traffic, WHERE and GoodFood gain functionality to make their applications stickier, and users benefit because they can make reservations with only a few taps of a finger. We were able to achieve this deep integration between our applications by using Android's Intent mechanism. Intents are perhaps one of Android's coolest, most unique, and under-appreciated features. Here's how we exploited them to compose a new user experience from parts each of us have.

Designing

One of the first steps is to design your Intent interface, or API. The main public Intent that OpenTable exposes is the RESERVE Intent, which lets you make a reservation at a specific restaurant and optionally specify the date, time, and party size.

Hereʼs an example of how to make a reservation using the RESERVE Intent:

startActivity(new Intent("com.opentable.action.RESERVE",
Uri.parse("reserve://opentable.com/2947?partySize=3")));

Our objective was to make it simple and clear to the developer using the Intent. So how did we decide what it would look like?

First, we needed an Action. We considered using Intent.ACTION_VIEW, but decided this didn't map well to making a reservation, so we made up a new action. Following the conventions of the Android platform (roughly <package-name>.action.<action-name>), we chose "com.opentable.action.RESERVE". Actions really are just strings, so it's important to namespace them. Not all applications will need to define their own actions. In fact, common actions such as Intent.ACTION_VIEW (aka "android.intent.action.VIEW") are often a better choice if youʼre not doing something unusual.

Next we needed to determine how data would be sent in our Intent. We decided to have the data encoded in a URI, although you might choose to receive your data as a collection of items in the Intent's data Bundle. We used a scheme of "reserve:" to be consistent with our action. We then put our domain authority and the restaurant ID into the URI path since it was required, and we shunted off all of the other, optional inputs to URI query parameters.

Exposing

Once we knew what we wanted the Intent to look like, we needed to register the Intent with the system so Android would know to start up the OpenTable application. This is done by inserting an Intent filter into the appropriate Activity declaration in AndroidManifest.xml:

<activity android:name=".activity.Splash" ... >
...
<intent-filter>
<action android:name="com.opentable.action.RESERVE"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="reserve" android:host="opentable.com"/>
</intent-filter>
...
</activity>

In our case, we wanted users to see a brief OpenTable splash screen as we loaded up details about their restaurant selection, so we put the Intent Filter in the splash Activity definition. We set our category to be DEFAULT. This will ensure our application is launched without asking the user what application to use, as long as no other Activities also list themselves as default for this action.

Notice that things like the URI query parameter ("partySize" in our example) are not specified by the Intent filter. This is why documentation is key when defining your Intents, which weʼll talk about a bit later.

Processing

Now the only thing left to do was write the code to handle the intent.

    protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Uri uri;
final int restaurantId;
try {
uri = getIntent().getData();
restaurantId = Integer.parseInt( uri.getPathSegments().get(0));
} catch(Exception e) {
// Restaurant ID is required
Log.e(e);
startActivity( FindTable.start(FindTablePublic.this));
finish();
return;
}
final String partySize = uri.getQueryParameter("partySize");
...
}

Although this is not quite all the code, you get the idea. The hardest part here was the error handling. OpenTable wanted to be able to gracefully handle erroneous Intents that might be sent by partner applications, so if we have any problem parsing the restaurant ID, we pass the user off to another Activity where they can find the restaurant manually. It's important to verify the input just as you would in a desktop or web application to protect against injection attacks that might harm your app or your users.

Calling and Handling Uncertainty with Grace

Actually invoking the target application from within the requester is quite straight-forward, but there are a few cases we need to handle. What if OpenTable isn't installed? What if WHERE or GoodFood doesn't know the restaurant ID?



Restaurant ID knownRestaurant ID unknown
User has OpenTableCall OpenTable IntentDon't show reserve button
User doesn't have OpenTableCall Market IntentDon't show reserve button

You'll probably wish to work with your partner to decide exactly what to do if the user doesn't have the target application installed. In this case, we decided we would take the user to Android Market to download OpenTable if s/he wished to do so.

    public void showReserveButton() {

// setup the Intent to call OpenTable
Uri reserveUri = Uri.parse(String.format( "reserve://opentable.com/%s?refId=5449",
opentableId));
Intent opentableIntent = new Intent("com.opentable.action.RESERVE", reserveUri);

// setup the Intent to deep link into Android Market
Uri marketUri = Uri.parse("market://search?q=pname:com.opentable");
Intent marketIntent = new Intent(Intent.ACTION_VIEW).setData(marketUri);

opentableButton.setVisibility(opentableId > 0 ? View.VISIBLE : View.GONE);
opentableButton.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
PackageManager pm = getPackageManager();
startActivity(pm.queryIntentActivities(opentableIntent, 0).size() == 0 ?
opentableIntent : marketIntent);
}
});
}

In the case where the ID for the restaurant is unavailable, whether because they don't take reservations or they aren't part of the OpenTable network, we simply hide the reserve button.



Publishing the Intent Specification

Now that all the technical work is done, how can you get other developers to use your Intent-based API besides 1:1 outreach? The answer is simple: publish documentation on your website. This makes it more likely that other applications will link to your functionality and also makes your application available to a wider community than you might otherwise reach.

If there's an application that you'd like to tap into that doesn't have any published information, try contacting the developer. It's often in their best interest to encourage third parties to use their APIs, and if they already have an API sitting around, it might be simple to get you the documentation for it.

Summary

It's really just this simple. Now when any of us is in a new city or just around the neighborhood its easy to check which place is the new hot spot and immediately grab an available table. Its great to not need to find a restaurant in one application, launch OpenTable to see if there's a table, find out there isn't, launch the first application again, and on and on. We hope you'll find this write-up useful as you develop your own public intents and that you'll consider sharing them with the greater Android community.

Monday, November 9, 2009

About Android

First of all, Android operating system is running on the Linux kernel 2.6.27, meaning stronger security, improved stability and a range of core applications enhancements. Android provides packs SIM Application Toolkit 1.0 and features are auto-checking and repair of SD cardfile-system. Just like the iPhone OS 3.0, Android comes with the SDK that adds new APIs which help developers create better apps.

Some of the features are simply catchup of the iPhone’s, like a new virtual keyboard or improved mobile web browser. Others are designed to add more punch through flashier eye candy, like animated window transitions, smooth, accelerometer-based application rotations between portrait and landscape modes and overall polish of user interface elements.

Android Features:
* Application framework enabling reuse and replacement of components
* Dalvik virtual machine optimized for mobile devices. -
* Integrated browser based on the open source WebKit engine
* Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
* SQLite for structured data storage
* Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
* GSM Telephony (hardware dependent)
* Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
* Camera, GPS, compass, and accelerometer (hardware dependent)
* Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE
* Support Other platform. Andriod NDK for c,c++ Developer and ASM for phython developers

Reference:
http://www.dalvikvm.com/ [1]

Top 10 features you’ll love about Android 1.5
  • Smart virtual keyboard
  • Home screen customizable with widgets
  • Live Folders for quick-viewing your data
  • Video recording and sharing
  • Picasa image uploading
  • Faster, standards-compliant browser
  • Voice Search
  • Stereo Bluetooth and hands-free calls
  • Snappier overall performance
  • Nice-to-haves
What are Other Mobile OS?
  • Symbian OS from Symbian Ltd,
  •  RIM BlackBerry operating system
  • iPhone OS from Apple Inc.
  • Windows Mobile from Microsoft
  • Linux operating system Palm webOS from Palm Inc.



The second Android Developer Challenge has begun! In this contest, real-world users will help review and score applications and the overall winner will take away $250,000 (read more...)


How to Program Google Android in eclipse
You can bulid your android application using the powerful Eclipse environment. This part introduces Android application development with the Eclipse plug-in, otherwise known as Android Development Tools. This provides an introduction to Android development with a quick introduction to the platform, a tour of Android Development Tools, and includes the construction of "Hello World " example applications.

Prerequisites
This section provides to setup the right environment to develop the android application.

System Requirements
Eclipse Platform
Get the latest version of Eclipse 3.5 (Galileo) from http://www.eclipse.org/galileo/ (V3.5 was used in this tutorial).

Android Developer Tools
Get the latest version of Android SDK from http://developer.android.com/sdk/index.html (V2.0 was used in this tutorial).


Set The Android Environment

Steps to Install Eclipse and Add plugin
1. Get the Eclipse 3.5 archieve File from http://www.eclipse.org/galileo/
2. Extract the archieve File and run the Eclipse
3. Click Help->Install New software->Add
4. Type : Name :Android plug-in
5. Install the Plug-in
6. Restart the Eclipse

Steps to Install Android SDK
2 : Run the Setup. - Goto the Commant pr
3 : You can see the popup (Android SDK and AVD Manager)
4 : If you encounter the following issue follow the solution, still if you have issue post your comments
----------------
Issue :Failed to fetch URL https://dl-ssl.google.com/andr oid/repository/repository.xml

Solution :
Step 1 : Run the Tool
Step 2 : Change settings options and checked in [ misc section "force https:// ... sources to be fetched using http://..." ]
Step 3 : Restart application
Step 4 : Ensure the Option Selected.
-----------------
5. Ensure your SDK is successfully updated.
Now the android environment is ready to create your application.


Develop Android Applications With Eclipse

You can develop your first android application using the below steps.

  • Create Emulator using the android toolkit
  • Configure Android SDK with your Eclipse
  • Create a demo Application

Create Device Using The Android Toolkit
1. Go to the SDK/tools/
2. Open a SDK Tool and run android.bat File
3. You can see the Android SDK and AVD Manager and Click "New"
4. Enter Device Name & Target Version and Click Create.

Configure Android SDK with your Eclipse
1. Open Eclipse
2. Go to preference : Window -> preference -> select Android
3. Browse and select the SDK Path (You can see the SDK version)
4. Apply and Close the preference popup

Create a demo Application
1. Open Eclipse and Create a new Android Project : File ->New -> Project -> Android Project
2. Enter the following data
1. project Name : Demo
2. Select Build Target : Android 1.1
3. Application Name : Demo
4. Package Name : com.demo
5. Create Activity : Demo
6. Min SDK Version : 2
3. Finally Click Finish
4. Check you application in project explorer
5. Run the your application : Run-> Run

About SDK Tool

You can find the following tools from your android sdk location
1. emulator – the emulator executable, that runs the APK files
2. adb – android debugger bridge, which is used to communicate with instances of the emulator
3. ddms – this is the debugger for the emulator executable

emulator – run your APK files
Run this program to launch the emulator that you can run your APK files in.
When you use plugins in your IDE to launch APK files, the emulator is started and the APK files are loaded it by the IDE.
otherwise you can using the below commands to install your application.


adb – install and uninstall APK files
The adb program is used to install APK files into the emulator that’s running.
Command : adb install
For example: “adb install SomeAndroidApp.apk”

To uninstall an APK file you have use adb to remove the file from the emulator itself.
For example: "adb shell rm data/app/SomeAndroidApp.apk"

*NOTE: To install or uninstall an APK file, please make sure that the emulator is already running.


ddms – debug and monitor your Android apps, and the emulator
This is the Android SDK emulator debugger. This is what you can do with your ebugger:

1. You can use this to look at LogCat output from your Android programs (Log.i(), Log.e(), etc) calls that are made in your Android program.
2. You can set the telephony status of your emulator. You can control the network data i/o speed and latency. You can even fake an incoming phone call into the emulator. You can even create an incoming SMS message.
3. You can take screenshots of the display of the emulator at any given time.
4. You can view the contents of the emulator’s filesystem. This is useful if you want to see where files are stored (that you download in your apps for example).

Here’s more information from Google Android docs on ddms.
The Eclipse plugin gives you full access to ddms functionality inside the IDE itself.

Emulator performance
To get an idea of what CPU speed your emulator is emulating try this:
1. start a shell session (adb shell),
2. then run "cat /proc/cpuinfo" to get the BogoMIPS.








Thursday, November 5, 2009

ADC 2 Round 2 Voting Open

The results from ADC 2 Round 1 are now tabulated and verified. With the top 200 applications identified, it's time to begin the final round judging. Be sure to download the ADC 2 judging application, or update your existing application, and help us select the final winners!

For the final round, both users and a Google-selected panel of industry judges will provide votes to determine the final winners. Prizes will be distributed to the top 3 entrants in each of the 10 categories, and the top 3 overall entrants will receive additional prizes. Please see our reference page for full challenge information.

Your vote is critical! We will keep voting open until we have received sufficient votes for all of the applications. We encourage you to download the ADC 2 judging application and evaluate entrants for yourself.

Download Android Developer Challenge 2:

Monday, November 2, 2009

Bring Your Lab Coats

With the recent release of Android 2.0 and the growing number of available devices, we want to give developers a convenient way to test drive their apps on these new devices. We also want to make our Android advocates available to answer any questions you may have.

We are pleased to announce that we will host a series of all day Android developer labs over the next month in the following cities (dates in local time):

  • Mountain View, CA - Nov 9
  • New York, NY - Nov 16
  • London, UK - Nov 17
  • Tokyo, JP - Nov 18
  • Taipei, TW - Nov 20

Due to limited space, developers who have already published an application in Android Market will be given priority. You can request a spot on a first-come, first-serve basis by going to this page. We will send a follow-up email with venue information and other registration details to those who have secured a spot.

Thank you for your continued excitement in Android. We look forward to meeting many of you in the coming weeks!