Azare Puasa

Note To Self

Connect

  • Facebook
  • Twitter
  • Linkedin
  • Home
  • Blog
  • My Fave Videos
  • Success Strategies
  • Achievements
  • Baking For Men
  • Matters of the Heart
  • Linux
  • WordPress
  • Programming
  • Book Review
  • Others

LBS and Google Maps in Android

Posted on June 19, 2010 by Azare Puasa

Since i am going through chapter 9 of “Android: A Programmer’s Guide” (ISBN:978-0-07-159988-7) and i can’t get the example app working, I put that aside today to work on other examples of Location Based applications. The first is here:

Using API Location

I used the emulator to run this app and I get the output similar to what is shown.  However, i haven’t figure out how to work with kml file. I meddled with the DDMS and loaded the kml manually but i cannot see the effect of that. I notice there was a GPS icon on my emulator the last i run it a few hours ago and now I don’t see it any more. Could be the changes on emulator’s settings that i did but I’m really not sure right now. I have to review this example.

I am now trying out this example app:

Using Google Maps in Android

Created the project, generated the Google Maps API key (the debug.keystore is in C:Documents and Settings<username>.android) and successfully displayed the map. There’s a bit fixing before i am able to display the map though. Firstly, Eclipse complaint that it has problem resolving  com.google.android.maps.MapActivity. Turns out that I was using Android 1.5 and the application requires Android 1.5 + Google API.  I have to install it (Windows ->Android SDK and AVD manager). Then I go my projects properties dialog as shown below (right click on project name and select properties). I checked the new target that i have just installed, click apply followed by okay button and the problem is solved!!

The second problem is the Android Virtual Device(AVD) the app requires is not compatible with the current one. So I have to create a new AVD. This is the command to create it:

android create avd -n my_android1.5 -t 3

-n is the name of the new AVD while -t argument is the target ID (which can be found by running the command “android list targets“). The final thing i did is check that i have type the code as instructed and this is what i achieved.

I’m still far away from completing this example but it is already 1.30 am and i need my rest.

Regarding the chapter 9 example, I haven’t figure out how to create a mock gps running for the emulator as required by the example. I am stuck with this example as well as it uses a LocationManager method, getCurrentLocation(), that is no longer available. In the forum, someone suggested getLastKnownLocation(). When i try this out, my application crashed when i press the “Where Am I” button.

About Azare

He is a full-time software developer and an Internet Infopreneur. He has a decade of experience developing Installshield Installscript. After getting his RHCE, he has short stint as a Redhat System Engineer. His work now involves coding Java language. In his free time, how dabbles with Wordpress website development and SEO. He loves archery and golf.

Contact Azare

Step 1 of 2

50%

Azare’s bookshelf: read

Click Millionaires: Work Less, Live More with an Internet Business You Love
Outsource Smart: Be Your Own Boss... Without Letting Your Business Be the Boss of You
How I Made My First Million on the Internet and How You Can Too!: The Complete Insider's Guide to Making Millions with Your Internet Business
Winning The Game of Life!
The $100 Startup: Reinvent the Way You Make a Living, Do What You Love, and Create a New Future
The Laptop Millionaire
Speed Reading in a Week: Teach Yourself
The 4-Hour Workweek
Think and Grow Rich
The Monk and the Riddle: The Education of a Silicon Valley Entrepreneur
Success as an Introvert for Dummies
The Clean Coder: A Code of Conduct for Professional Programmers
Be Rich and Happy
Celebrating Failure: The Power of Taking Risks, Making Mistakes, and Thinking Big
The Art of Readable Code
A Gift to My Children: A Father's Lessons for Life and Investing
Zero to One: Notes on Startups, or How to Build the Future

Copyright ©2025 · Azare Puasa - All Rights Are Reserved · Terms & Conditions· Privacy Policy

Copyright © 2025 · Azare Puasa on Genesis Framework · WordPress · Log in