Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 3rd, 2011, 04:26 AM
Authorized User
Points: 172, Level: 3
Points: 172, Level: 3 Points: 172, Level: 3 Points: 172, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2010
Posts: 21
Thanks: 0
Thanked 6 Times in 4 Posts
Default Chapter 9 - LBS

Hi Readers:

---------------

For Chapter 9, page 306, step 2, main.xml should be AndroidManifest.xml.

---------------

For Chapter 9, page 322, you need to add in the following permissions in order for your application to receive location coordinates:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.learn2develop.LBS"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="11" />

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOC ATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCAT ION"></uses-permission>

<application android:icon="@drawable/icon" android:label="Where Am I">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Sorry for the omission!

Thanks,
Wei-Meng Lee

Last edited by weimenglee; May 16th, 2011 at 10:18 AM.
Reply With Quote
The Following User Says Thank You to weimenglee For This Useful Post:
mikemwambia (November 4th, 2013)
  #2 (permalink)  
Old July 26th, 2011, 10:47 AM
Registered User
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I downloaded the code and put everything in place.
all I changed is the API key for the Google maps.

everything is working fine untill I try to change the location with the Eclipse emulator control (DDMS). The connection between the emulator and the DDMS is dropped:
- in the "devices" tab/view, all items (eg com.android.launcher, com.android.systemui, ...) under the emulator disappear
- in the "debug" view, it says <terminated> and <disconnected>

I've downloaded and installed an entirely new Eclipse + ADK to ensure they are up to date. Still fails.

When I disable the part about the locationlistener in MainActivity.java, changing the location via the emulator control does not cause the emulator to be disconnected anymore (but of course, the location of the map in the app is not changed either).

Any suggestions?
Reply With Quote
  #3 (permalink)  
Old July 26th, 2011, 10:51 AM
Authorized User
Points: 172, Level: 3
Points: 172, Level: 3 Points: 172, Level: 3 Points: 172, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2010
Posts: 21
Thanks: 0
Thanked 6 Times in 4 Posts
Default

Hi:
I suppose your AVD is Android 2.3.x? Try using an older version of the Android, say by creating an AVD using Android 2.2. That should work. Seems like the Android 2.3.x has some problems when sending it location coordinates.

Hope this helps!

Wei-Meng
Reply With Quote
  #4 (permalink)  
Old July 26th, 2011, 10:58 AM
Registered User
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much for you ultra fast reply. Wish I had tried asking the question before losing a day reinstalling everything :)

Works like a charm now. Perfect!
what a relief...
Reply With Quote
  #5 (permalink)  
Old July 2nd, 2013, 11:06 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default Map not displaying

I have checked the code very carefully against Chapter 9 of Beginning Android Applications and have checked that the API key I generated and logged with the Google APIs console is correctly entered and cannot get map to display (just the grid) in my test app, either on emulator or my Samsung Galaxy Mini which does have internet access. Not sure where else to look, could you offer a hint please?
Reply With Quote
  #6 (permalink)  
Old July 14th, 2013, 03:04 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi westcoastrider,

Did you figure out the issue with the map? I have the same problem...

Quote:
Originally Posted by westcoastrider View Post
I have checked the code very carefully against Chapter 9 of Beginning Android Applications and have checked that the API key I generated and logged with the Google APIs console is correctly entered and cannot get map to display (just the grid) in my test app, either on emulator or my Samsung Galaxy Mini which does have internet access. Not sure where else to look, could you offer a hint please?
Reply With Quote
  #7 (permalink)  
Old July 15th, 2013, 09:05 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by AndreyU View Post
Hi westcoastrider,

Did you figure out the issue with the map? I have the same problem...
I'm afraid not yet, I have some other stuff I need to do so it's had to go on the back burner, but it's very frustrating so if you come across anything I'd be interested to know. Google maps is so easy to use on the web you wouldn't expect there to be so many hurdles when developing for Android
Reply With Quote
  #8 (permalink)  
Old November 14th, 2013, 12:05 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2013
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default LBS PROJECT

In the last project of the LBS chapter has a project of location tracking application i have tried to develop it as per the code and in eclipse it deosn't show any error when i deploy it on a real device as a unsigned application it says application cant install anybody please help............
Help much appreciated
Reply With Quote
  #9 (permalink)  
Old November 14th, 2013, 05:08 PM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by mikemwambia View Post
In the last project of the LBS chapter has a project of location tracking application i have tried to develop it as per the code and in eclipse it deosn't show any error when i deploy it on a real device as a unsigned application it says application cant install anybody please help............
Help much appreciated
You may need to set your phone's permissions so it will allow you to install apps not purchased from an apps store - this is usually set to prevent this as a protection against third party malicious software being downloaded.

I did get the map working in the end, but because of work pressure in other areas I haven't gone much further with it I'm afraid. Can't really remember what I did, which I know isn't very helpful, but I do recall having to fiddle with my settings on Google API console to ensure that the right app was registered correcly with the right permissions, if that's any help at all. Good luck!
Reply With Quote
The Following User Says Thank You to westcoastrider For This Useful Post:
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM



All times are GMT -4. The time now is 03:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.