1. Download our Official Android App: Forums for Android!

Apps Error with AccelerometerPlay Sample of the SDK

Discussion in 'Android Development' started by lugopaco, Apr 6, 2011.

  1. lugopaco

    lugopaco Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    30
    Joined:
    Mar 31, 2011

    Mar 31, 2011
    30
    0
    15
    Student
    Mexico
    Hi. I'm some kind of new at the Java language and to the ANDROID. I was checking the samples that comes with the SDK and that of the accelerometer caught particulary my attention, but once I tried to run it to see what it does, appeared that I've got 2 errors:

    -The method onAccuracyChanged(Sensor, int) of type AccelerometerPlayActivity.SimulationView must override a superclass method AccelerometerPlayActivity.java /AccelerometerPlay/src/com/example/android/accelerometerplay line 457 Java Problem

    -The method onSensorChanged(SensorEvent) of type AccelerometerPlayActivity.SimulationView must override a superclass method AccelerometerPlayActivity.java /AccelerometerPlay/src/com/example/android/accelerometerplay line 378 Java Problem

    And 1 warning:

    -Attribute minSdkVersion (5) is lower than the project target API level (10) AndroidManifest.xml /AccelerometerPlay line 1 Android ADT Problem

    I will really apreciate any kind of help!!!!!!!
     

    Advertisement

  2. pietjuhhh1990

    pietjuhhh1990 Well-Known Member
    Rank:
    None
    Points:
    38
    Posts:
    235
    Joined:
    Feb 21, 2011

    Feb 21, 2011
    235
    22
    38
    App/web development
    Netherlands
    Add @Override above the method

    Add @Override above the method

    Your API (android version) is honycomb(10)
    In your manifest you've enterd donut (5)
    You can edit this in your manifest.xml
     
    lugopaco likes this.
  3. lugopaco

    lugopaco Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    30
    Joined:
    Mar 31, 2011

    Mar 31, 2011
    30
    0
    15
    Student
    Mexico
    It has already both @Override.

    Think You're right; it has to be because the android versions.

    Thanks pietjuhhh1990 for answer.
     
  4. Seabubbles

    Seabubbles Lurker
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Nov 27, 2011

    Nov 27, 2011
    1
    0
    5
    Hi Lugopaco,
    very simple to fix: do the opposite of what pietjuhhh1990 wrote! :eek:

    1) Delete the @Override lines (377 and 456) before the method onAccuracyChanged(Sensor, int) and onSensorChanged(SensorEvent).

    2) Ignore the warning! "Attribute minSdkVersion (5) is lower than the project target API level (10)" is not a problem it's absolutely correct! :D

    Hope this helps...
     
  5. YanDaik

    YanDaik Lurker
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Aug 21, 2012

    Aug 21, 2012
    1
    0
    5
    Have you solved it? I have same trouble :(


    Emm well it fixes the problem but it does not looks like right solution. Probably this functions won't be called right on the device.
     

Share This Page

Loading...