Discussion Forums  >  Uncategorized

Replies: 12    Views: 339

amitsingh800
I hate code!
Profile
Posts: 7
Reg: Jan 14, 2011
location unknow...
70
01/16/11 08:43 AM (15 years ago)

My Quiz's last question is going out of Screen

Hello All, Need help I have developed a quiz, when i run the application in eclipse it triggers the emulator using Google API paltform 1.6, API Level 4 the quiz is running fine but the answers section is going out of screen, last answers option is going out of screen. Please help
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/16/11 10:02 AM (15 years ago)
Have you tested your app on an actual device? There are literally hundreds of simulators / emulators for the Android developmenet setup in Eclipse and almost NONE of them work exactly like the phones. iOS does this very well, the iPhone simulator works great. Android, not so much. a) set your device to allow debugging (device settings) b) Connect it to your maching with the USB cable c) Run your project from Eclipse but choose your device from the AVD manager instead of the simulator.
 
amitsingh800
I hate code!
Profile
Posts: 7
Reg: Jan 14, 2011
location unknow...
70
like
01/16/11 10:44 AM (15 years ago)
Thanks!, probably this is emulator problem then, because otherwise the quiz is working fine.will try using the actual device.
 
Tom Shortridge
Aspiring developer
Profile
Posts: 78
Reg: Nov 22, 2010
Virginia
1,480
like
01/18/11 12:43 PM (15 years ago)
amitsingh800, I'm having an identical problem when attempting to test my quiz on my Droid Eris - am going into the code now to see if I can figure out how to possibly change the sizes of the buttons so that all 4 fit on the screen. Will post if any progress is made - and if anyone else has a knowledge of this, feel free to chime in!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/18/11 12:58 PM (15 years ago)
Hi Guys... sounds like maybe there is a layout problem we're unaware of. We don't have an Eris - we mostly use the Motorola Droid for testing on actual devices. Sounds like the screen resolution / screen size on the Eris is the problem. Have a look at the layout file for the quiz screen. It's in: /res/layout/screen_quizmultiplechoice.xml In that file you'll see the configuration data for the layout of the Wrong and Right quiz buttons. The width / height should be scalaed automatically by the device but it may be too large or something? 85dpi means 85 device independent pixels Let us know if you find a layout that will work for the quiz on the smaller devices?
 
Tom Shortridge
Aspiring developer
Profile
Posts: 78
Reg: Nov 22, 2010
Virginia
1,480
like
01/18/11 01:06 PM (15 years ago)
David, thanks for the pointer to the correct file - I actually changed the heights on the btnQuestion_1, 2, 3, and 4, rather than the Right/Wrong quiz buttons, to 40dip. That makes everything fit for the Eris, though I don't know if it'll be to small on the Droid or similar now. Again, thanks for providing this service!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
01/18/11 01:10 PM (15 years ago)
You're welcome... good tip on the 40dip. I'll tinker here in the next few days and see if I can improve the device detection logic to professionalize it ;-)
 
Linda
Lost but trying
Profile
Posts: 8
Reg: Feb 01, 2011
USA
80
like
03/18/11 09:08 AM (14 years ago)
Hello - we ran into the same problem on the HTC Droid - the last answer does not show on the screen and you can't scroll to view it.
 
Linda
Lost but trying
Profile
Posts: 8
Reg: Feb 01, 2011
USA
80
like
03/18/11 09:27 AM (14 years ago)
I am unable to access the menu_quizmultiplechoice.xml file - it won't show the code - Errors: java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source) at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067) at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607) at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:352) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768) at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:365) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526) at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/18/11 05:11 PM (14 years ago)
The menu_quizmultiplechoice.xml is a simple text file, you don't need anything special to open it. You can open it in Eclipse, or in a text editor. The errors posted in the previous thread are mysterious - could it be that you are trying to 'build and run' an XML file (which won't work). Expand the layout folder in the project, scroll down and see all the xml files, click one to edit it. Again, it's just plain text.
 
G8torBrent
Aspiring developer
Profile
Posts: 27
Reg: Mar 04, 2011
location unknow...
270
like
03/20/11 08:13 PM (14 years ago)
I changed mine from 58 DIP to 50 DIP for it to work on the emulator. Fixes it. But it's still not pulling the right background image for the quiz (pulls the app image instead of the quiz_bg.png (which I changed for my iOS version and wanted to change on the Android version).
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/21/11 12:32 AM (14 years ago)
@ G8torBrent what did you change from 58 to 50? If it's what I think it is, it has zero to do with the background image (quiz_bg.png).
 
G8torBrent
Aspiring developer
Profile
Posts: 27
Reg: Mar 04, 2011
location unknow...
270
like
03/21/11 04:56 AM (14 years ago)
Absolutely right, David. It was the button height. I zigged a little bit in my comment above, just because the quiz is where I've been having problems on the Android side. I started a thread for the wrong image issue.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.