• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Error with AccelerometerPlay Sample of the SDK

lugopaco

Newbie
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!!!!!!!
 
-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
Add @Override above the method

-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
Add @Override above the method

-Attribute minSdkVersion (5) is lower than the project target API level (10) AndroidManifest.xml /AccelerometerPlay line 1 Android ADT Problem
Your API (android version) is honycomb(10)
In your manifest you've enterd donut (5)
You can edit this in your manifest.xml
 
It has already both @Override.

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

Thanks pietjuhhh1990 for answer.
 
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...
 
Have you solved it? I have same trouble :(


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

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.
 
Back
Top Bottom