Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

Sunday, November 23, 2008

A minimal Android application to display Map, using MapView

it's a very minimal Android application using MapView to display a Map on Android Phone.

My Setup is:
Ubuntu 8.10
Eclipse 3.4.1
Android SDK 1.0

First of All, start Eclipse and create a Android Project:
In my exercise, I use AndroidMap as the name.
Project Name - AndroidMap
Package Name - com.Android.AndroidMap
Activity Name - AndroidMap
Application Name - AndroidMap



Now you have to grant permission to the application to access internet:
Select AndroidManifest.xml in res folder from Package Window on the left. Activate Permissions tab, then Add two Uses Permission, android.permission.ACCESS_COARSE_LOCATION and android.permission.INTERNET.





In order to use MapView, uses-library, "com.google.android.maps", have to be defined inside AndroidManifest.xml. Activate AndroidManifest.xml to manual edit the xml directly, insert

<uses-library android:name="com.google.android.maps" />

inside the <Application> element. The full listing of my AndroidManifest.xml:



Save and close AndroidManifest.xml.

Modify UI, (Package Window>res Folder>layout Folder>main.xml), by replacing TextView with MapView:

<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="api_key_here" />


Please note that you MUST to insert your own "api_key_here".
In order to apply your own apiKey, you have to check your Getting the MD5 Fingerprint of the SDK Debug Certificate (for emulator), and Sign Up for the Android Maps API.



Save and close main.xml.

Finally, modify AndroidMap.java:

package com.Android.AndroidMap;
import com.google.android.maps.MapActivity;
import android.os.Bundle;

public class AndroidMap extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}

@Override
protected boolean isRouteDisplayed() {
return false;
}
}



Save the java file.

Now you can Run the minimal AndroidMap on Emulator.





SORRY for all! Blogger re-format my code and make all the code mis-aligned, and not easy to read. I don't know how to fix it!!!

Sunday, November 2, 2008

Android Developers - Bonsai Blast


Jacob Abrams of Glu Mobile talks about they built their Android app, Bonsai Blast.

Sunday, September 28, 2008

The new look of Emulator of Android SDK 1

Google I/O 2008 - An Introduction to Android


An Introduction to Android
Jason Chen

Android is the Open Handset Alliance's mobile software platform. In this session, we introduce Android and discuss our vision for more open, powerful, and useful mobile devices.

Tuesday, August 26, 2008

Android 0.9 SDK beta

Updated Android 0.9 SDK beta is available to download:
http://code.google.com/android/download.html

The Andoid 0.9 SDK beta includes:

  • Extensions, changes and improvements to the framework and library APIs
  • New developer tools
  • Enhancements to existing developer tools
  • Redesigns to the home screen, some applications and UI
  • Plus various other improvements throughout the system

To take advantage of these features, you need to install the new SDK and upgrade your existing Android applications. The sections below guide you through the process.

With updated Android Emulator

http://code.google.com/android/reference/emulator.html

The Android SDK includes a mobile device emulator -- a virtual mobile device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device.

The Android emulator mimics all of the typical hardware and software features of a typical mobile device, except that it can not receive or place actual phone calls. It provides a variety of navigation and control keys, which you can "press" using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other Android applications running.

To help you model and test your application, the emulator lets your application use the services of the Android platform to invoke other applications, access the network, play audio and video, store and retrieve data, notify the user, and render graphical transitions and themes.

The emulator also includes a variety of debug capabilities, such as a console from which you can log kernel output, simulate application interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and dropouts on the data channel.


Monday, December 3, 2007

Install Android SDK and Eclipse's Android Development Tools plugin

out-dated information!!!
Pls. refer here, "Install Android SDK on Eclipse 3.5 Galileo", for update information. ~edited 2009-07-18.

In order to setup Eclipse for development of Android, both Install Android SDK and Eclipse's Android Development Tools plugin are needed.

Download Android SDK and unzip it in any folder you want, it's "C:\App\android_sdk_windows_m3-rc22a" for me.

Android Development Tools plugin can be download inside Eclipse IDE.

  1. Start Eclipse, then select Help > Software Updates > Find and Install....
  2. In the dialog that appears, select Search for new features to install and press Next.
  3. Press New Remote Site.
  4. In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
    https://dl-ssl.google.com/android/eclipse/
    Press OK.
  5. You should now see the new site added to the search list (and checked). Press Finish.
  6. In the subsequent Search Results dialog box, select the checkbox for Android Plugin > Eclipse Integration > Android Development Tools and press Next.
  7. Read the license agreement and then select Accept terms of the license agreement, if appropriate. Press Next.
  8. Press Finish.
  9. The ADT plugin is not signed; you can accept the installation anyway by pressing Install All.
  10. Restart Eclipse.
  11. After restart, update your Eclipse preferences to point to the SDK directory:
    1. Select Window > Preferences... to open the Preferences panel. (Mac OS X: Eclipse > Preferences)
    2. Select Android from the left panel.
    3. For the SDK Location in the main panel, press Browse... and locate the SDK directory.
    4. Press Apply, then OK.


Friday, November 30, 2007

Android Emulator

The Android SDK includes a mobile device emulator — a virtual device that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device.



More: Android Emulator - Android

[remark: any SPAM commetns will be reported to Google.]

Thursday, November 29, 2007

Androidology@YouTube

Part 1 of 3 - Architecture Overview

Part 2 of 3 - Application Lifecycle

Part 3 of 3 - APIs