• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Beginner Droid Project

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again coderanch. I've been using instructions to write this
Droid code & I can't seem to get a few things right. I went over
it a couple times & can't figure out where or what i'm doing wrong.
Here's the code


Any help would be greatly appreciated. Thanks!
 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What problem you are facing? It is easy to start with that instead of guessing..
 
Bp Parker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tushar Goel wrote:What problem you are facing? It is easy to start with that instead of guessing..



It's solved now Tushar Goel, but earlier I kept getting multiple line errors
on the code. Come to find out everytime I told the system to

I would close it out with a wich kept closing my methods.
 
Marshal
Posts: 8612
623
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Please post your fixed code, so we could make sure you actually got it fixed, as at the moment I'm finding more problems than you pointed out.
 
Bp Parker
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Working Code:
 
Liutauras Vilda
Marshal
Posts: 8612
623
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Keep batteryLevel as private variable. Always like that, otherwise someone can drain your battery by directly accessing instance variable.
2. method chargeBattery. Need to keep phone for 100 hours to get it charged from 0 to 100?
3. same method as above, hmm, it doesn't look good to me. More than 100% could be...
 
reply
    Bookmark Topic Watch Topic
  • New Topic