Aller au contenu

Application Android 2.2


Recommended Posts

Bonjour, dans le cadre d'un projet de stand d'exposition, je souhaite pouvoir integrer a mon application un appareil photo qui permettra de référencer les objets des différentes stands.

Toutefois, j'ai un problème. J'ai trouvé des tutoriels pour les Android 1.x. http://www.kinox-fr.com/post/2009/08/Developpement-prendre-une-photo-avec-Android .

Mais mon téléphone est sous android 2.2 et cela ne fonctionne pas. Je ne suis pas très fort en développement d'application et je ne trouve pas de tutoriels pour android 2.2.

Quelqu'un aurait - il une piste pour m'orienter s'il vous plait?

Cordialement,

Lien vers le commentaire
Partager sur d’autres sites

donc ça signifie que il y a une erreur dans ton code en général.

Donc il faudrait que tu regardes quelle erreur tu as dans le "logcat".

Normalement dans Eclipse tu as un onglet nommé "Log" qui ressemble à ça :

http://3.bp.blogspot.com/_S-fPXiX0FeA/S_p9RXfBUWI/AAAAAAAAAD8/GsBDEYEPA8E/s1600/debug4.JPG

tu dois avoir un packet de ligne rouge comme dans l'image, et il faudrait nous donner ce qu'il y a dedant qu'on puisse savoir où est ce que ça a crashé dans ton code et pourquoi.

tu as essayé de voir avec le debugger à quelle ligne ça a crashé ?

Lien vers le commentaire
Partager sur d’autres sites

07-08 10:04:37.969: DEBUG/PowerManagerService(208): New lightsensor value:1280, lcdValue:255

07-08 10:04:38.649: DEBUG/AndroidRuntime(15402): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<

07-08 10:04:38.649: DEBUG/AndroidRuntime(15402): CheckJNI is OFF

07-08 10:04:38.649: DEBUG/dalvikvm(15402): creating instr width table

07-08 10:04:38.709: DEBUG/AndroidRuntime(15402): --- registering native functions ---

07-08 10:04:38.989: DEBUG/AndroidRuntime(15402): Shutting down VM

07-08 10:04:38.989: DEBUG/dalvikvm(15402): Debugger has detached; object registry had 1 entries

07-08 10:04:38.999: INFO/AndroidRuntime(15402): NOTE: attach of thread 'Binder Thread #3' failed

07-08 10:04:39.179: DEBUG/AndroidRuntime(15411): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<

07-08 10:04:39.179: DEBUG/AndroidRuntime(15411): CheckJNI is OFF

07-08 10:04:39.179: DEBUG/dalvikvm(15411): creating instr width table

07-08 10:04:39.229: DEBUG/AndroidRuntime(15411): --- registering native functions ---

07-08 10:04:39.509: INFO/ActivityManager(208): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.takepicture/.TakePicture }

07-08 10:04:39.589: DEBUG/AndroidRuntime(15411): Shutting down VM

07-08 10:04:39.599: DEBUG/dalvikvm(15411): Debugger has detached; object registry had 1 entries

07-08 10:04:39.609: INFO/AndroidRuntime(15411): NOTE: attach of thread 'Binder Thread #3' failed

07-08 10:04:39.619: INFO/ActivityManager(208): Start proc com.android.takepicture for activity com.android.takepicture/.TakePicture: pid=15419 uid=10128 gids={1006, 1015}

07-08 10:04:39.699: DEBUG/AK8973(181): Compass Start

07-08 10:04:39.699: INFO/WindowManager(208): Setting rotation to 1, animFlags=1

07-08 10:04:39.739: INFO/ActivityManager(208): Config changed: { scale=1.0 imsi=208/20 loc=fr_FR touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=54}

07-08 10:04:39.879: ERROR/TakePicture(15419): onCreate

07-08 10:04:39.929: ERROR/TakePicture(15419): onResume

07-08 10:04:39.969: DEBUG/PowerManagerService(208): New lightsensor value:640, lcdValue:255

07-08 10:04:39.969: INFO/ActivityManager(208): Displayed activity com.android.takepicture/.TakePicture: 390 ms (total 390 ms)

07-08 10:04:40.119: ERROR/TakePicture(15419): surfaceCreated

07-08 10:04:40.119: WARN/CameraSwitch(15419): open main camera

07-08 10:04:40.119: WARN/CameraSwitch(15419): no file - can't switch camera

07-08 10:04:40.129: WARN/com.skype.raider.MainApp(7587): onConfigurationChanged changed:{ scale=1.0 imsi=208/20 loc=fr_FR touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=54}

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): Client(99) constructor

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): Create new client(99) from pid 177, url=/system/media/audio/ui/camera_click.ogg, connId=99

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): setDataSource(/system/media/audio/ui/camera_click.ogg)

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): player type = 3

07-08 10:04:40.279: DEBUG/MediaPlayerService(177): player type = VORBIS_PLAYER

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): create VorbisPlayer

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): setDataSource

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): [99] setAudioStreamType(7)

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): [99] prepareAsync

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): [99] notify (0x17388, 1, 0, 0)

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): Client(100) constructor

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): Create new client(100) from pid 177, url=/system/media/audio/ui/VideoRecord.ogg, connId=100

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): setDataSource(/system/media/audio/ui/VideoRecord.ogg)

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): player type = 3

07-08 10:04:40.279: DEBUG/MediaPlayerService(177): player type = VORBIS_PLAYER

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): create VorbisPlayer

07-08 10:04:40.279: VERBOSE/MediaPlayerService(177): setDataSource

07-08 10:04:40.289: VERBOSE/MediaPlayerService(177): [100] setAudioStreamType(7)

07-08 10:04:40.289: VERBOSE/MediaPlayerService(177): [100] prepareAsync

07-08 10:04:40.289: VERBOSE/MediaPlayerService(177): [100] notify (0x2aa08, 1, 0, 0)

07-08 10:04:40.289: ERROR/TakePicture(15419): surfaceChanged

07-08 10:04:40.289: ERROR/QualcommCameraHardware(177): Invalid preview size requested: 533x270

07-08 10:04:40.299: DEBUG/AndroidRuntime(15419): Shutting down VM

07-08 10:04:40.299: WARN/dalvikvm(15419): threadid=1: thread exiting with uncaught exception (group=0x400259f8)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): FATAL EXCEPTION: main

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): java.lang.RuntimeException: setParameters failed

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.hardware.Camera.native_setParameters(Native Method)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.hardware.Camera.setParameters(Camera.java:655)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at com.android.takepicture.TakePicture.surfaceChanged(TakePicture.java:199)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.SurfaceView.updateWindow(SurfaceView.java:546)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.View.draw(View.java:6742)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.widget.FrameLayout.draw(FrameLayout.java:352)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.drawChild(ViewGroup.java:1648)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.View.draw(View.java:6742)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.widget.FrameLayout.draw(FrameLayout.java:352)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewRoot.draw(ViewRoot.java:1422)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.os.Handler.dispatchMessage(Handler.java:99)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.os.Looper.loop(Looper.java:144)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.app.ActivityThread.main(ActivityThread.java:4937)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at java.lang.reflect.Method.invokeNative(Native Method)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at java.lang.reflect.Method.invoke(Method.java:521)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at dalvik.system.NativeStart.main(Native Method)

07-08 10:04:40.309: WARN/ActivityManager(208): Force finishing activity com.android.takepicture/.TakePicture

07-08 10:04:40.309: INFO/WindowManager(208): Setting rotation to 0, animFlags=1

07-08 10:04:40.309: INFO/ActivityManager(208): Config changed: { scale=1.0 imsi=208/20 loc=fr_FR touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=17 seq=55}

07-08 10:04:40.549: WARN/com.skype.raider.MainApp(7587): onConfigurationChanged changed:{ scale=1.0 imsi=208/20 loc=fr_FR touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34 uiMode=17 seq=55}

07-08 10:04:40.619: DEBUG/dalvikvm(361): GC_FOR_MALLOC freed 6622 objects / 523200 bytes in 80ms

07-08 10:04:40.817: WARN/ActivityManager(208): Activity pause timeout for HistoryRecord{477a28c0 com.android.takepicture/.TakePicture}

07-08 10:04:40.959: DEBUG/dalvikvm(295): GC_FOR_MALLOC freed 104 objects / 960296 bytes in 44ms

07-08 10:04:40.999: DEBUG/dalvikvm(295): GC_FOR_MALLOC freed 5 objects / 192648 bytes in 29ms

07-08 10:04:41.029: DEBUG/dalvikvm(295): GC_FOR_MALLOC freed 3 objects / 260168 bytes in 29ms

07-08 10:04:41.209: DEBUG/AK8973(181): Compass CLOSE

07-08 10:04:42.670: DEBUG/dalvikvm(208): GC_EXPLICIT freed 9193 objects / 439712 bytes in 161ms

07-08 10:04:46.969: DEBUG/PowerManagerService(208): New lightsensor value:1280, lcdValue:255

07-08 10:04:50.939: WARN/ActivityManager(208): Activity destroy timeout for HistoryRecord{477a28c0 com.android.takepicture/.TakePicture}

07-08 10:04:50.969: DEBUG/PowerManagerService(208): New lightsensor value:2600, lcdValue:255

07-08 10:04:57.970: DEBUG/PowerManagerService(208): New lightsensor value:1280, lcdValue:255

07-08 10:05:20.969: DEBUG/PowerManagerService(208): New lightsensor value:640, lcdValue:255

07-08 10:05:23.219: VERBOSE/KeyguardViewMediator(208): password timeout now

07-08 10:05:24.969: DEBUG/PowerManagerService(208): New lightsensor value:1280, lcdValue:255

07-08 10:05:28.969: DEBUG/PowerManagerService(208): New lightsensor value:320, lcdValue:255

07-08 10:05:45.070: VERBOSE/AlarmManager(208): Adding Alarm{47654280 type 2 com.google.android.apps.maps} déc. 13 09:52:16 soir

07-08 10:05:48.110: VERBOSE/AlarmManager(208): Adding Alarm{47650300 type 2 com.google.android.apps.maps} déc. 13 09:52:16 soir

07-08 10:05:51.149: VERBOSE/AlarmManager(208): Adding Alarm{4764c3b8 type 2 com.google.android.apps.maps} déc. 13 09:52:16 soir

07-08 10:05:54.009: VERBOSE/AlarmManager(208): Adding Alarm{47646688 type 2 com.google.android.apps.maps} déc. 13 09:52:16 soir

07-08 10:05:55.969: DEBUG/PowerManagerService(208): New lightsensor value:640, lcdValue:192

07-08 10:05:58.449: DEBUG/lights(208): set_light_backlight

07-08 10:05:58.469: DEBUG/AK8973(181): Compass Start

07-08 10:05:58.729: DEBUG/AK8973(181): Compass CLOSE

07-08 10:06:00.670: VERBOSE/AlarmManager(208): Alarm triggering: Alarm{477cb378 type 2 android}

07-08 10:06:00.729: VERBOSE/AlarmManager(208): Adding Alarm{473602b8 type 2 android} janv. 04 11:47:01 soir

07-08 10:06:00.869: WARN/GDataClient(361): Unable to execute HTTP request.java.net.UnknownHostException: android.clients.google.com

07-08 10:06:00.869: DEBUG/Sync(361): Unable to process gdata feed: android.clients.google.com

07-08 10:06:00.879: DEBUG/SyncManager(208): failed sync operation authority: subscribedfeeds account: Account {name=joris.geronimo.narbonne@gmail.com, type=com.google} extras: [] syncSource: 4 when: 337591152 expedited: false, SyncResult: stats [ numIoExceptions: 1]

07-08 10:06:30.729: VERBOSE/AlarmManager(208): Alarm triggering: Alarm{473602b8 type 2 android}

07-08 10:06:30.779: VERBOSE/AlarmManager(208): Adding Alarm{47280500 type 2 android} janv. 04 11:49:48 soir

Lien vers le commentaire
Partager sur d’autres sites

ce qu'il faut chercher dans le logcat, c'est où est ton code dans la pile d'exécution :

ce qui est interessant dans ton logcat c'est cette ligne :

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at com.android.takepicture.TakePicture.surfaceChanged(TakePicture.java:199)

<< a la ligne 199 de ton fichier TakePicture.java, tu fais quelque chose qui fait planter ton application, et en particulier

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): java.lang.RuntimeException: setParameters failed

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.hardware.Camera.native_setParameters(Native Method)

07-08 10:04:40.299: ERROR/AndroidRuntime(15419): at android.hardware.Camera.setParameters(Camera.java:655)

donc une modification de parametre a été refusé (setParameters failed)

juste apres tu as ce message

07-08 10:04:40.289: ERROR/QualcommCameraHardware(177): Invalid preview size requested: 533x270

<<== est ce que tu demanderais une preview size de 533x270 pixels? visiblement le driver sur ton tel QualcommCameraHardware refuse.

et quand tu cherches ca sur internet, tu trouves :

http://stackoverflow.com/questions/2046523/runtimeexception-on-camera-setparameters-on-nexus-one

The solution is to request the closest available preview size to the one you'd like; you can get a list of available preview sizes by calling getSupportedPreviewSizes in the Camera.Parameters object returned by Camera.getParameters.

tu ne peux pas mettre n'importequelle taille de preview, il faut demander au telephone ce qu'il peut te donner, et choisir... ca ne sera peut-être pas plein écran, mais bon...

apprend a lire les logcats, et cherche sur internet, c'est le mieux si tu veux des solutions a tes problèmes...

ET POSTE DANS LE BON FORUM, ICI C'EST PAS POUR DEBUGGER C'EST POUR PARLER DE TON APPLICATION :o ( mais c'est vrai que si je t'aide alors que tu n'es pas sur le bon forum, je motive ce comportement :emo_im_lips_are_sealed: )

Lien vers le commentaire
Partager sur d’autres sites

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

×
×
  • Créer...