amirmarmul / DroidAR

Augmented Reality Library for Android
1 stars 0 forks source link

GPS stays on (no way to remove listener?) #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Created an own Setup-Class which extends Setup
2. Using ArActivity with an instance of the custom Setup-Class
3. Starting the Application, going to the ArActivity, switching back to another 
activity.

What is the expected output? What do you see instead?
The location updates should be turned off and the GPS module should turn off as 
well.

What version of the product are you using? On what operating system?
Current version, Android 2.2.1

Please provide any additional information below.
I can't see a way to turn off the location updates by hand. The event manager 
should recognize when there isn't any listener left and should tell the 
LocationManager to turn off updates.

Original issue reported on code.google.com by jpan...@gmail.com on 30 Nov 2011 at 11:18

GoogleCodeExporter commented 8 years ago
I will fix the problem with the eventmanager und unregister all listeners when 
the app is not visible to the user.

The behaviour will soon be like in the following example:

12-02 17:01:12.836: D/Setup(13766): main onStart 
12-02 17:01:12.836: D/Setup(13766): main onResume 

loading screen displayed (ar view still visible behind it):
12-02 17:01:12.846: D/Setup(13766): main onPause 
loading screen disappears:
12-02 17:01:16.089: D/Setup(13766): main onResume 

opening other application in front:
12-02 17:01:41.014: D/Setup(13766): main onPause 
12-02 17:01:43.166: D/Setup(13766): main onStop 
free camera, pause worldupdater and renderer, pause eventmanager

resuming to droidar:
12-02 17:01:45.758: D/Setup(13766): main onRestart 
register for camera, resume worldupdater and renderer, resume eventmanager
12-02 17:01:45.758: D/Setup(13766): main onStart
12-02 17:01:45.768: D/Setup(13766): main onResume 

pressing back in droidar (ArActivity is closed):
12-02 17:03:09.120: D/Setup(13766): main onPause
12-02 17:03:11.012: D/Setup(13766): main onStop 
free camera, pause worldupdater and renderer, pause eventmanager

somewhere in the future onDestroy is called when the application is killed by 
the system

Original comment by simon.heinen on 2 Dec 2011 at 4:55

GoogleCodeExporter commented 8 years ago
Ok i need some feedback now, if the implemented concept is working on all the 
devices and all android versions. Please do the following on as many phones as 
possible:

Open any DroidAR AR view, then press home, them open the camera app, close the 
camera app, return to the DroidAR app and check if everything is still working 
correctly (the AR view should still be displayed, input and sensor mapping 
should work as well as animations, camera view, etc).

Original comment by simon.heinen on 3 Dec 2011 at 11:05

GoogleCodeExporter commented 8 years ago
Hi Simon,
thanks for fixing it that fast.
I've tested it on this devices so far:
Nexus S, 2.3.6 - ok
Motorola Milestone, 2.1 - update 1 - ok
HTC Wildfire 2, 2.2.1 - ok
HTC Legend, 2.2.1 - first try to re-open our app after switching to the camera 
app resulted in an error:

java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.native_setup(Native Method)
at android.hardware.Camera.<init>(Camera.java:118)
at android.hardware.Camera.open(Camera.java:91)
at system.CameraView.surfaceCreated(CameraView.java:39)
at android.view.SurfaceView.updateWindow(SurfaceView.java:540)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:206)
at android.view.View.dispatchWindowVisibilityChanged(View.java:3890)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:727)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:727)
at android.view.ViewRoot.performTraversals(ViewRoot.java:748)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4914)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)

Second try worked.

Cheers,
Jonas

Original comment by jpan...@gmail.com on 4 Dec 2011 at 1:10

GoogleCodeExporter commented 8 years ago
G1, 1.6 works as well

Original comment by jpan...@gmail.com on 4 Dec 2011 at 2:37

GoogleCodeExporter commented 8 years ago
Thanks for your feedback :)

Original comment by simon.heinen on 6 Dec 2011 at 6:43