[android-developers] Are the Dialog Buttons considered Views?
Pretty straightforward question, really. Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Are the Dialog Buttons considered Views?
I suppose I should have qualified that a little more, I'm a tad more experienced than just needing the Button documentation. I've been attempting to speed up the dismissal of the soft keyboard when a Dialog I have is closed. I have a previous post, here: http://groups.google.com/group/android-developers/browse_thread/thread/eb90583c1ba79f73 After playing with the idea a bit more, this seems to work to dismiss the keyboard consistently during the Dialog's onClick(), imm being the InputMethodService, and password is the AlertDialog instance. imm.hideSoftInputFromWindow(password.getWindow().getCurrentFocus().getWindowToken(), 0); The Dialog has a single EditText view which has focus right up until the Dialog's onClick fires, when it definitely loses focus based on tests I've ran. The question then was... what view then does have focus? Whatever is returned by password.getWindow().getCurrentFocus() seems to be the answer, but it's none of the views created by myself... which then leads to the question... are those Buttons Views that can be returned (other than by getWindow().getCurrentFocus() if it is really returning that View)? On Feb 8, 9:31 am, kernelpanic j.m.roya...@gmail.com wrote: pretty straightforward answer then - from the docs here -http://developer.android.com/reference/android/widget/Button.html java.lang.Object ↳ android.view.View ↳ android.widget.TextView ↳ android.widget.Button On Feb 8, 11:07 am, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Pretty straightforward question, really. Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: InputMethodManager and it's active View
I spent some time researching InputMethodManager.java and besides having a ton of threading code I couldn't follow, the best I could gather was that whatever view currently has focus SHOULD be able to invoke showSoftInput as it the InputMethod's active view. After much further testing... the only conclusion that I can come to is that the InputMethodManager Service is not getting flagged soon enough that the view I'm trying to use to call the softInput has focus. I threw a little test together... I subclassed Thread and created a constructor that takes the Activity so I can call runOnUIThread from that started Thread. In the View's onFocusChangeListenter, I start the thread, have it sleep for just a moment, and then have it call runOnUIThread() and in it's Runnable call to showSoftInput() and viola... it works just fine. This is hackish... but since what I'm working on is entirely my own personal project for only my hardware... it'll have to do. On Feb 1, 3:21 pm, TreKing treking...@gmail.com wrote: On Tue, Feb 1, 2011 at 5:10 PM, Jeremiah Sellars sylus.mcf...@gmail.comwrote: I will try that, but part of the problem, is when to call clearFocus() and requestFocus(). I've tried that after the dialog is shown, but it doesn't work. Try requesting focus on something else first, then the EditText. I certainly don't have to have it work this way... it was just something I thought would be much easier than it's become and have gotten wrapped up in finding a solution and wanting to understand how the InputMethodManager is tracking the active view. I know that feeling. You stupid machine, you will not defeat me! =P Good luck. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] InputMethodManager and it's active View
I would like to know if there is any way to determine and set what view is active to the InputMethodManger. I have a scenario where attempting to show the soft keyboard is always returning false. Asking for imm.isActive() returns true so some view is active... but I have not been able to determine which it is. The scenario I have is an AlertDialog containing a single EditText view. In my main activity, I click a button that launches the Dialog. I have an onFocusChangeListenter set on the EditText which checks when it receives focus and based on log messages it is receiving focus successfully when the dialog is displayed. However, I am running several checks inside if(hasFocus) and the all return false. Here are some of the tests I'm running during onFocusChange(View v, boolean hasFocus). imm is the InputMethodManager called with the usual convention of (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE). ((EditText)v).isInputMethodTarget() returns false imm.isActive(v) returns false imm.isActive() returns true, so some view is active for input... imm.showSoftInput(v, 0) does not show the view and returns false. imm.showSoftInput(mAlertDialog.getListView(), 0) also returns false, thinking possibly the ListView for the dialog was the view which was active, though it is not. I'm hoping someone might be able to steer me in the right direction. I HAVE been able to show the keyboard by getting the Window, then IBinder WindowToken and passing that to setSoftInputMode, but then it behaves erratically afterward. Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: InputMethodManager and it's active View
I realized I did not end up including that. Yes, it does come up as expected when tapped. I've actually been looking through the TextView.java code to see if I can implement what is happening when it is touched/clicked... but that's getting a bit over my head. I will try that, but part of the problem, is when to call clearFocus() and requestFocus(). I've tried that after the dialog is shown, but it doesn't work. I'm pretty close to extending Dialog and trying to give the view focus during it's own onStart() but that seems completely nuts to go through all that. I'm really just wondering if the InputMethodManager is just lagging behind on noticing the focus change... but since I don't know how it works... I certainly don't have to have it work this way... it was just something I thought would be much easier than it's become and have gotten wrapped up in finding a solution and wanting to understand how the InputMethodManager is tracking the active view. On Feb 1, 2:56 pm, TreKing treking...@gmail.com wrote: On Tue, Feb 1, 2011 at 3:43 PM, Jeremiah Sellars sylus.mcf...@gmail.comwrote: The scenario I have is an AlertDialog containing a single EditText view. In my main activity, I click a button that launches the Dialog. I have something similar. The soft keyboard does not come up immediately, but does come up once you tap it. Do you need it to be immediately as the dialog is shown? If that's the case, I would try removing then re-requesting focus on the EditText. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Samsung Captivate sdcard issues.
I'm not particularly concerned with how users get game data on their media... I suppose if that ended up really being a problem I could put up a walk through of some kind. The primary concern is if I give out directions and say... put these files in a folder call game on your external sd card, just for example, incredible users would be fine and captivate users would not. getExternalStorageDirectory() is returning the Captivates internal sd storage, plain and simple. I guess it really isn't all that big of a deal... I throw up instructions that say what to do and then list instructions for the exceptions... On Aug 4, 10:02 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Aug 4, 2010 at 12:11 PM, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Are there any talks of how this can be addressed? What specifically is the problem you are facing? For example, if getExternalStorageDirectory() does not give you something you can write to, that would be a problem. From your description, the only thing that seems different is that getExternalStorageDirectory() does not point to removable storage. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: New to android finally leaving Windows !!!
I would recommend the Captivate. It's Hummingbird processor is very nice (basically the same as what is in the IPhone 4... samsung sold them their chips as I understand it... though the IPhone 4 SOC has one other component (though CPU and GPU are the same)). If it's okay to say it now... it is rootable (legally I suppose as things are now...) and I'm quite happy with it. The driver setup, however, to get it hooked up to my computer was a tad difficult... but it is the one and only Android device worth getting on ATT. The Aria (forget the manufacturer) is nice, but doesn't have the same caliber of CPU. On Jul 7, 10:17 am, Martin martinj...@gmail.com wrote: I would love to start developing for Android- I am currently on the ATT network. How does one acquire a test device? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Samsung Captivate sdcard issues.
Hello fellow android devs, There appears to be more internal sdcard path location issues on the horizon... I recently got my hands on a lovely Samsung Captivate... quite a nice phone. It, like the HTC Incredible, has an internal sdcard as well as a slot for an external one. I had a chance to play with a friends Incredible, and the external card's path is returned when calling: File sdfile = Environment.getExternalStorageDirectory(); String sdpath = sdfile.getPath(); ... and it works as expected, giving /sdcard as the path. I've not been on the group lately, so I'm not certain how the issue with accessing the Incredible's internal sd storage has been handled... but on the Captivate... Unlike the Incredible... when calling the same function, the same path is returned, BUT it's pointing to the internal sd storage... The external is instead mounted at /sdcard/sd My app needs to access files on an sdcard somewhere... I guess I don't care where exactly and I can provide instructions in a readme and even maybe prompt the user and ask where they copied the game files but I'd much rather be able to decide a standard location and stick to it. Are there any talks of how this can be addressed? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: getting x and y coorinates in onclick event
If I understand correctly, there wouldn't be a x/y location associated with onClick. A click is just a selection action and can be triggered through a touch or other selection method. I'm pretty sure you'd need to do it through the onTouchEvent() On May 21, 9:30 am, social hub shubem...@gmail.com wrote: In onclicklistener onclick how to get the x and y coordinates where its clicked. any one any ideas Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How soon is isFinishing() triggered?
...or when is the earliest I can detect it? Here's my situation... I've got an OpenGL game in the works. When the activity is ended (however this happens either by Android or user quitting) I'd like like to do some cleanup. I'm already calling a native function to free some memory that was allocated and those calls are fine, but I'm also trying to call glDeleteTextures(). I've tried a few things and currently I have this in OnPause()... @Override protected void onPause() { super.onPause(); mGSGLView.onPause(); if(isFinishing()){ GSNFreeMem(); //Native cleanup function } } Logcat complains that I'm calling an OpenGL ES API when there is no current context. I've read some threads about what to look for and checking for back button presses, etc... seems bad so I want to let Android tell me when to do this. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Error trying to use XML Layout and extended GLSurfaceView
I won't beat around the bush here... I'm trying to put my GLSurfaceView (called ShapeSurfaceView) into a relative layout. Before trying to use a layout, everything has been working fine simply instantiating the view and calling setContentView(mShapeSurfaceView). Since I got this error I researched how to create the layout completing in the Java and that is working quite nicely... it's just a ton of code to setup the layout, view and rules for the view. I'd really rather have the XML method working. Here's the main XML, I've added no other views yet: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent com.maximusdev.tests3d.ShapeSurfaceView android:id=@+id/glview android:layout_width=fill_parent android:layout_height=fill_parent / /RelativeLayout The java from onCreate, nothing special... setContentView(R.layout.main); mShapeSurfaceView = (ShapeSurfaceView)findViewById(R.id.glview); Here is the logcat error. My previous logcat error was mentioning the class constructor missing the AttributeSet parameter so I added that to the constructor for the ShapeSurfaceView yet still ended up with this. 05-05 18:22:40.327: ERROR/AndroidRuntime(294): Uncaught handler: thread main exiting due to uncaught exception 05-05 18:22:40.337: ERROR/AndroidRuntime(294): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maximusdev.tests3d/com.maximusdev.tests3d.My3DTest}: java.lang.NullPointerException 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2401) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2417) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.os.Handler.dispatchMessage(Handler.java:99) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.os.Looper.loop(Looper.java:123) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.ActivityThread.main(ActivityThread.java:4203) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at java.lang.reflect.Method.invokeNative(Native Method) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at java.lang.reflect.Method.invoke(Method.java:521) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at dalvik.system.NativeStart.main(Native Method) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): Caused by: java.lang.NullPointerException 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at com.maximusdev.tests3d.My3DTest.onCreate(My3DTest.java:30) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1123) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2364) 05-05 18:22:40.337: ERROR/AndroidRuntime(294): ... 11 more -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Error trying to use XML Layout and extended GLSurfaceView
Got this in the Eclipse console the next time I opened it, searching for the top error isn't getting me very far... [2010-05-05 13:13:49 - main.xml] Parser is not a BridgeXmlBlockParser! java.lang.NullPointerException at android.view.View.init(View.java:1841) at android.widget.TextView.init(TextView.java:326) at com.android.layoutlib.bridge.MockView.init(MockView.java:33) at android.view.SurfaceView.init(SurfaceView.java:45) at android.view.SurfaceView.init(SurfaceView.java:41) at android.view.SurfaceView.init(SurfaceView.java:37) at android.opengl.GLSurfaceView.init(GLSurfaceView.java:189) at com.maximusdev.tests3d.ShapeSurfaceView.init(ShapeSurfaceView.java: 14) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(Unknown Source) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java: 198) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java: 126) at android.view.LayoutInflater.rInflate(LayoutInflater.java:617) at android.view.LayoutInflater.inflate(LayoutInflater.java:407) at android.view.LayoutInflater.inflate(LayoutInflater.java:296) at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onConfigurationChange(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onTargetChange(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.onDescriptorsChanged(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.initUiRootNode(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor $1.updateEditor(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor $1.onTargetLoaded(Unknown Source) at com.android.ide.eclipse.adt.AdtPlugin$16.run(Unknown Source) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java: 134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java: 3855) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java: 2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java: 332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java: 493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java: 149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java: 113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java: 194) 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: 368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java: 179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more
[android-developers] Re: Maximum Texture Units
That's an interesting question... I may have to drop by the khronos forums and ask that. Thanks again Robert for those benchmarks, it's helpful to know what I'm dealing with. On May 2, 6:38 pm, Lance Nanek lna...@gmail.com wrote: It wouldn't surprise me if the Droid has that little. Its graphics solution breaks the scene up into tiles, which results in less data being needed at any one time. It also performs depth testing before doing the texturing, so uses less texture data due to that as well. Isn't OpenGL supposed to transparently start swapping texture objects between main memory and video memory for you when you run out of video memory? Using it all up may manifest more as a noticeable drop in performance than an outright error. On May 2, 4:42 am, Robert Green rbgrn@gmail.com wrote: I remember reading that the MSM7200-based phones have 8mb of VRAM and so I have to imagine that you could count on at least that much for the better GPUs. What's weird though is that I keep finding things talking about how the PowerVR SGX530 has 2MB of VRAM which seems awfully low - unless that's a texture cache and there is a larger chunk of VRAM that is implementation-specific. I don't know.. I couldn't find any info on the QS8250 (snapdragon 1ghz) VRAM. So far I've never run out of vram on any device and I'm loading quite a bit in on some games. Antigen uses: 256x512 32 bit for story start text atlas 256x512 32 bit for main text atlas 256x512 32 bit for level bg front 512x512 16 bit for level bg back 5 256x256 32 bit for characters, shading and faces 7 64x64 32 bit for items several for the HUD and many other smaller ones for glow, particles, etc.. My new 3D game uses (all mipmapped so add 33% more size on): 1024x1024 16 bit for main level texture 512x512 16 bit for level lightmap 4x 512x512 16 bit for characters 3x 256x256 16 bit for weapons 256x512 32 bit for text atlas about 512K-1MB of geometry VBOs 256x256 32 bit for HUD graphics Many smaller 32 bit ones for projectiles and other small things So really there seems to be ample room there. Both of those scenarios load fine on a G1. If you want to write an easy test, write a loop that loads up a 512 32 bit (1MB) texture into VRAM and keep count of how many times it works until gl.glGetError() returns the out of memory error after glTexImage2D. I'd be curious as to what your results are. On May 2, 1:06 am, Jeremiah Sellars sylus.mcf...@gmail.com wrote: This may be just another silly question then, but after doing quite a few searches about different phones... I'm finding the amount of general RAM but not VRAM. Does anyone know this spec for newer phones? I'm developing with Droid or better phones in mind... On May 1, 6:02 am, Mario Zechner badlogicga...@gmail.com wrote: gentextures only creates handles for you. Actual memory for the bitmap data is allocated when calling glteximage2D. That will be your biggest limitation as video ram is of course limited. How much vram is available is dependent on the chipset/device you are running your application on. On 1 Mai, 00:59, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Oh, geez... okay that explains it. Thanks to both of you, that really explains it well. Is there then a limit on the number of textures GenTextures can return? On Apr 30, 3:39 pm, Robert Green rbgrn@gmail.com wrote: Yeah multiple texture units are only needed for multitexturing, of which the most common use is for lightmapping. On Apr 30, 4:57 pm, Mario Zechner badlogicga...@gmail.com wrote: The number of texture units and the maximum texture size are not really related in any way. The number of texture units tells you how many textures you can use simultaniously when drawing geometry (how many textures can be bound at once). You can have more textures in video ram than there are texture units, however, you can only bind #texture units textures at any time. A maximum of 2 texture units is sufficient for most scenarios where you have a diffuse texture and a lightmap for example. The maximum texture size is really just an estimate with most drivers and depends on things such as internal storage (which might be fixed by the driver anyways) and so on. In any case, both numbers will differ from device to device or rather chipset to chipset. On 30 Apr., 23:19, Jeremiah Sellars sylus.mcf...@gmail.com wrote: I'm wondering if this is just an issue with how the emulator is setup, but I'm not sure. I'm (natively) calling this: int maxt = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS, maxt); __android_log_print(ANDROID_LOG_VERBOSE, Native, Max textures %d
[android-developers] Re: Maximum Texture Units
This may be just another silly question then, but after doing quite a few searches about different phones... I'm finding the amount of general RAM but not VRAM. Does anyone know this spec for newer phones? I'm developing with Droid or better phones in mind... On May 1, 6:02 am, Mario Zechner badlogicga...@gmail.com wrote: gentextures only creates handles for you. Actual memory for the bitmap data is allocated when calling glteximage2D. That will be your biggest limitation as video ram is of course limited. How much vram is available is dependent on the chipset/device you are running your application on. On 1 Mai, 00:59, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Oh, geez... okay that explains it. Thanks to both of you, that really explains it well. Is there then a limit on the number of textures GenTextures can return? On Apr 30, 3:39 pm, Robert Green rbgrn@gmail.com wrote: Yeah multiple texture units are only needed for multitexturing, of which the most common use is for lightmapping. On Apr 30, 4:57 pm, Mario Zechner badlogicga...@gmail.com wrote: The number of texture units and the maximum texture size are not really related in any way. The number of texture units tells you how many textures you can use simultaniously when drawing geometry (how many textures can be bound at once). You can have more textures in video ram than there are texture units, however, you can only bind #texture units textures at any time. A maximum of 2 texture units is sufficient for most scenarios where you have a diffuse texture and a lightmap for example. The maximum texture size is really just an estimate with most drivers and depends on things such as internal storage (which might be fixed by the driver anyways) and so on. In any case, both numbers will differ from device to device or rather chipset to chipset. On 30 Apr., 23:19, Jeremiah Sellars sylus.mcf...@gmail.com wrote: I'm wondering if this is just an issue with how the emulator is setup, but I'm not sure. I'm (natively) calling this: int maxt = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS, maxt); __android_log_print(ANDROID_LOG_VERBOSE, Native, Max textures %d, maxt); This only outputs 2... could it be possible that I'm going to be allowed only 2 textures? That seems impossible... GL_MAX_TEXTURE_SIZE reports 4096 which is more than enough. I suppose you could lay everything out on a couple of 4096x 4096 images (seems a bit crazy) but anyway... Am I just running into one of things that will be different per phone processor? Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http
[android-developers] Maximum Texture Units
I'm wondering if this is just an issue with how the emulator is setup, but I'm not sure. I'm (natively) calling this: int maxt = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS, maxt); __android_log_print(ANDROID_LOG_VERBOSE, Native, Max textures %d, maxt); This only outputs 2... could it be possible that I'm going to be allowed only 2 textures? That seems impossible... GL_MAX_TEXTURE_SIZE reports 4096 which is more than enough. I suppose you could lay everything out on a couple of 4096x 4096 images (seems a bit crazy) but anyway... Am I just running into one of things that will be different per phone processor? Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Maximum Texture Units
Oh, geez... okay that explains it. Thanks to both of you, that really explains it well. Is there then a limit on the number of textures GenTextures can return? On Apr 30, 3:39 pm, Robert Green rbgrn@gmail.com wrote: Yeah multiple texture units are only needed for multitexturing, of which the most common use is for lightmapping. On Apr 30, 4:57 pm, Mario Zechner badlogicga...@gmail.com wrote: The number of texture units and the maximum texture size are not really related in any way. The number of texture units tells you how many textures you can use simultaniously when drawing geometry (how many textures can be bound at once). You can have more textures in video ram than there are texture units, however, you can only bind #texture units textures at any time. A maximum of 2 texture units is sufficient for most scenarios where you have a diffuse texture and a lightmap for example. The maximum texture size is really just an estimate with most drivers and depends on things such as internal storage (which might be fixed by the driver anyways) and so on. In any case, both numbers will differ from device to device or rather chipset to chipset. On 30 Apr., 23:19, Jeremiah Sellars sylus.mcf...@gmail.com wrote: I'm wondering if this is just an issue with how the emulator is setup, but I'm not sure. I'm (natively) calling this: int maxt = 0; glGetIntegerv(GL_MAX_TEXTURE_UNITS, maxt); __android_log_print(ANDROID_LOG_VERBOSE, Native, Max textures %d, maxt); This only outputs 2... could it be possible that I'm going to be allowed only 2 textures? That seems impossible... GL_MAX_TEXTURE_SIZE reports 4096 which is more than enough. I suppose you could lay everything out on a couple of 4096x 4096 images (seems a bit crazy) but anyway... Am I just running into one of things that will be different per phone processor? Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Creating folder on emulated sd card.
Do you have this permission in your AndroidManifest.xml? uses-permission android:name=android.permission.WRITE_EXTERNAL_STORAGE / On Apr 21, 6:22 pm, nayana urs nayana...@gmail.com wrote: hi all am able to upload photos to sdcard and my code is working to edit photos but later am not able to save images in sd card can anyone please help me On Wed, Apr 21, 2010 at 10:21 PM, Jeremiah Sellars sylus.mcf...@gmail.comwrote: Hello everyone, I'm currently only testing things in an emulator due to not having an Android device as of yet. I'm honestly holding out for some of the new 1 Ghz machines to come out and do some comparisons. Anyway, I would imagine one would easily be able to make whatever folders they choose on an sd card, but on the emulated one, I can only seem to push entire folder contents or single files to the root. The adb help doesn't appear to have a command to make a folder. Is this not possible, or am I just missing something? Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- with regards Nayana -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Creating folder on emulated sd card.
Hello everyone, I'm currently only testing things in an emulator due to not having an Android device as of yet. I'm honestly holding out for some of the new 1 Ghz machines to come out and do some comparisons. Anyway, I would imagine one would easily be able to make whatever folders they choose on an sd card, but on the emulated one, I can only seem to push entire folder contents or single files to the root. The adb help doesn't appear to have a command to make a folder. Is this not possible, or am I just missing something? Thanks everyone, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Creating folder on emulated sd card.
Hi Mark, Thanks so much, that worked wonderfully. All the best, Jeremiah On Apr 21, 9:53 am, Mark Murphy mmur...@commonsware.com wrote: Jeremiah Sellars wrote: Hello everyone, I'm currently only testing things in an emulator due to not having an Android device as of yet. I'm honestly holding out for some of the new 1 Ghz machines to come out and do some comparisons. Anyway, I would imagine one would easily be able to make whatever folders they choose on an sd card, but on the emulated one, I can only seem to push entire folder contents or single files to the root. The adb help doesn't appear to have a command to make a folder. Is this not possible, or am I just missing something? To create a directory on the SD card in the emulator, run: adb shell mkdir /sdcard/HereIsMyDirectory (substituting in whatever name you want) Or, just run: adb shell to give you a limited Linux shell where you can mkdir, ls, and such as needed. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training in US: 14-18 June 2010:http://bignerdranch.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: glGetIntegerv() with GL11.GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES
Shoot... Well, alright. Seems a shame to run all that extra code, but I'll give it a whirl. I don't suppose there's any rumors about OpenGL ES 1.1 being more supported? I suppose this could be one of those time running some native code would come in handy? On Dec 16, 8:06 pm, Robert Green rbgrn@gmail.com wrote: Short answer: Unfortunately, you have to track it yourself. On Dec 16, 9:36 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: This where using GL_MODELVIEW_MATRIX didn't seem to populate the buffer with anything, this did actually work to some extent. However, calling this right after gl.glLoadIdentity() put values in the buffer in the 0, 5, 12 and 15th positions as expected, but instead of 1, or 65536 the values there are 1065353216. Is that useful in any way at all, or should I track the matrix in a separate matrix (running operations on it as well...) myself? Thanks all, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] glGetIntegerv() with GL11.GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES
This where using GL_MODELVIEW_MATRIX didn't seem to populate the buffer with anything, this did actually work to some extent. However, calling this right after gl.glLoadIdentity() put values in the buffer in the 0, 5, 12 and 15th positions as expected, but instead of 1, or 65536 the values there are 1065353216. Is that useful in any way at all, or should I track the matrix in a separate matrix (running operations on it as well...) myself? Thanks all, Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GLSurfaceView.Renderer render rate
First, thanks Robert... that's going to help a lot. I've not had to use threading before and it looks to be a must on Android for games so I'm making sure I understand the concepts as clearly as possible. I'm quite thankful that Java's tutorials are as good as they are. I was almost thinking of trying to make the game logic wait and just trigger it when the renderer fires. My thought being... things like collision only need to be checked (I'd be checking one frame ahead of course) on a new render. Would that be a terrible idea? Secondly... hooray that posts (not sure if it's per individual or not) aren't having to wait days to appear... On Dec 14, 10:35 pm, Robert Green rbgrn@gmail.com wrote: If you're using the render-continuously mode, she'll go as fast as she can go. 60FPS if you're doing easy HW-accel 2D or very basic 3D. I've never seen over 60FPS. It's probably vsynced to that. I like to use a shared object called the World to pass between my logic thread and renderer thread. Logic updates world, renderers draws it. Simple! I keep a simple boolean isLocked on the World and synchronize the calls to getLock() and release(). You will want to set a max rate for your logic thread to run and have it figure out how many MS to sleep for. I didn't do that the first time and mine would run at 200-300fps while rendering at 30-60. That was a big waste of CPU cycles :) None of my code does that anymore. On Dec 14, 9:58 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: I suppose I should add... that my background is homebrew for Nintendo DS and coding in C. The game loop would generally just include a call to wait for the screen's vertical blank and that was ~1/60th of a second. It couldn't be relied upon totally for timing, but as long as you weren't running really intense operations it was fine. DS Homebrew is substantially closer to the hardware and the combination of learning Java, OOP concepts, working with a very large API and applying everything to a new platform is causing me to ask some likely stupid questions. Anyway, I hope someone can find a moment to help. Thanks again, Jeremiah On Dec 14, 3:51 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Hello everyone, Continuing to tackle a game project, I've learned tons and have tons more to learn. From what I've picked up, a proper game would have at least 3 threads. The main activity thread which would likely double as the UI thread, the GL Renderer thread which is setup automatically with the GLSurfaceView.Renderer and then a Game Logic thread. As I understand it, I'll need to make sure to setup a sleep timing in the game logic thread to have it behave correctly, but what I'm not sure on is at what timing is the Renderer thread working at? Exactly how often is onDrawFrame() being called? Thanks everyone! Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] GLSurfaceView.Renderer render rate
Hello everyone, Continuing to tackle a game project, I've learned tons and have tons more to learn. From what I've picked up, a proper game would have at least 3 threads. The main activity thread which would likely double as the UI thread, the GL Renderer thread which is setup automatically with the GLSurfaceView.Renderer and then a Game Logic thread. As I understand it, I'll need to make sure to setup a sleep timing in the game logic thread to have it behave correctly, but what I'm not sure on is at what timing is the Renderer thread working at? Exactly how often is onDrawFrame() being called? Thanks everyone! Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GLSurfaceView.Renderer render rate
I suppose I should add... that my background is homebrew for Nintendo DS and coding in C. The game loop would generally just include a call to wait for the screen's vertical blank and that was ~1/60th of a second. It couldn't be relied upon totally for timing, but as long as you weren't running really intense operations it was fine. DS Homebrew is substantially closer to the hardware and the combination of learning Java, OOP concepts, working with a very large API and applying everything to a new platform is causing me to ask some likely stupid questions. Anyway, I hope someone can find a moment to help. Thanks again, Jeremiah On Dec 14, 3:51 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Hello everyone, Continuing to tackle a game project, I've learned tons and have tons more to learn. From what I've picked up, a proper game would have at least 3 threads. The main activity thread which would likely double as the UI thread, the GL Renderer thread which is setup automatically with the GLSurfaceView.Renderer and then a Game Logic thread. As I understand it, I'll need to make sure to setup a sleep timing in the game logic thread to have it behave correctly, but what I'm not sure on is at what timing is the Renderer thread working at? Exactly how often is onDrawFrame() being called? Thanks everyone! Jeremiah -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GLSurfaceView and Key Presses
Sorry to double post... I swear what I described before (setting just an OnKeyListener) worked... but trying again today it did not. I tried to add an OnFocusChangedListener and just calling myViewName.requestFocus(); which quite oddly worked once... but then never again... I'm quite puzzled by this behavior. What's even more puzzling, is that I'm trying to pick up the letter G being pressed and it seems to be suggesting kanji (hiragana or katakana, I'm not sure which)... Numbers work fine... why does pressing a letter steal focus away from the GLSurfaceView? On Nov 30, 12:18 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Following the samples and examples, I've successfully been able to load a model on screen and rotate it with the DPAD keys and overriding the onKeyDown method of the GLSurfaceView. Trying to use a letter though, causes a small box to appear at the bottom accepting the text that is being typed. What I'm not entirely clear on, is since I don't have a listener defined in the main Activity, why those key letter key presses are being intercepted by some other inherent listener(?). I setup an OnKeyListener for the view to call my own method and that does work... but I'm wondering if there is perhaps a better way to handle it. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Getting an asset outside of main Activity
Thanks... I'm learning more and more and realize that handing the context over will give more broad access if it were needed. There's so many classes and methods to learn to use, it's just bound to take some time. I hadn't used getApplicationContext yet and am glad to know it exists now as well. Thanks so much for replying, -Jeremiah On Dec 1, 2:47 pm, Dianne Hackborn hack...@android.com wrote: You say you are -instantiating- an AssetManager? Generally what one does is just hand the Context to whatever function needs to access resources/assets/whatever, and let it retrieve what it needs from that. Context is the main handle on the information about your app. Do be sure, though, if you are handing your Activity (which is a Context) to some other code, that it doesn't hold on to this in some static globals, since that can lead to major leaks (since the Activity/Context basically holds the entire world of that activity, including UI, bitmaps, and everything related). If you really need a Context in globals, you can use getApplicationContext to retrieve the global context for your app. On Mon, Nov 30, 2009 at 1:17 PM, Jeremiah Sellars sylus.mcf...@gmail.comwrote: (I did post this to the beginners group, but it's been several days without response. Let me know if a double post like this is frowned upon... It feels like a basic question, but anyway...) Hello everyone, From digging around a bit, getAssets() is an inherited method from ContextWrapper. It returns an AssetManager, and using open() it can return an InputStream. What I'm attempting to do at this point, is use the GLSurfuceViewActivity, Cube and CubeRenderer to work and learn off of and read in vertex data from a binary file. I've already created the binary output by parsing a model obj file and added to the assets directory. My Shape class (modified from the Cube class) does not have access to calling getAssets() since it's not a subclass of Activity or ContextWrapper. Once I accepted that, I tried to think of the best way to read in the data (without storing it extra places) to the Shape class. What I did, and seems to be working okay, was modify the Shape and ShapeRenderer constructors to accept an AssetManger as a parameter. In the main Activity I added a private AssetManager, instatiated it in the onCreate() method from the main Activity, and passed that into the Renderer like so: am = getAssets(); mGLSurfaceView.setRenderer(new ShapeRenderer(am)); Does this sound reasonable or totally off base? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GLSurfaceView and Key Presses
Triple sorry I suppose... I ended up poking around in the emulator settings (this is a 2.0 compatible emulator) and found some Language and Keyboard settings that made a difference. I disabled the Japanese IME (not sure even what that is) and the other option above it showing in all (possibly Chinese?) unknown characters. Once those were disabled, my tests pick up other letters without any extra funny business. Is this a setting I'm likely to have to worry about? Will I need to tell players to disable such settings? On Dec 1, 1:56 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Sorry to double post... I swear what I described before (setting just an OnKeyListener) worked... but trying again today it did not. I tried to add an OnFocusChangedListener and just calling myViewName.requestFocus(); which quite oddly worked once... but then never again... I'm quite puzzled by this behavior. What's even more puzzling, is that I'm trying to pick up the letter G being pressed and it seems to be suggesting kanji (hiragana or katakana, I'm not sure which)... Numbers work fine... why does pressing a letter steal focus away from the GLSurfaceView? On Nov 30, 12:18 pm, Jeremiah Sellars sylus.mcf...@gmail.com wrote: Following the samples and examples, I've successfully been able to load a model on screen and rotate it with the DPAD keys and overriding the onKeyDown method of the GLSurfaceView. Trying to use a letter though, causes a small box to appear at the bottom accepting the text that is being typed. What I'm not entirely clear on, is since I don't have a listener defined in the main Activity, why those key letter key presses are being intercepted by some other inherent listener(?). I setup an OnKeyListener for the view to call my own method and that does work... but I'm wondering if there is perhaps a better way to handle it. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] GLSurfaceView and Key Presses
Following the samples and examples, I've successfully been able to load a model on screen and rotate it with the DPAD keys and overriding the onKeyDown method of the GLSurfaceView. Trying to use a letter though, causes a small box to appear at the bottom accepting the text that is being typed. What I'm not entirely clear on, is since I don't have a listener defined in the main Activity, why those key letter key presses are being intercepted by some other inherent listener(?). I setup an OnKeyListener for the view to call my own method and that does work... but I'm wondering if there is perhaps a better way to handle it. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Getting an asset outside of main Activity
(I did post this to the beginners group, but it's been several days without response. Let me know if a double post like this is frowned upon... It feels like a basic question, but anyway...) Hello everyone, From digging around a bit, getAssets() is an inherited method from ContextWrapper. It returns an AssetManager, and using open() it can return an InputStream. What I'm attempting to do at this point, is use the GLSurfuceViewActivity, Cube and CubeRenderer to work and learn off of and read in vertex data from a binary file. I've already created the binary output by parsing a model obj file and added to the assets directory. My Shape class (modified from the Cube class) does not have access to calling getAssets() since it's not a subclass of Activity or ContextWrapper. Once I accepted that, I tried to think of the best way to read in the data (without storing it extra places) to the Shape class. What I did, and seems to be working okay, was modify the Shape and ShapeRenderer constructors to accept an AssetManger as a parameter. In the main Activity I added a private AssetManager, instatiated it in the onCreate() method from the main Activity, and passed that into the Renderer like so: am = getAssets(); mGLSurfaceView.setRenderer(new ShapeRenderer(am)); Does this sound reasonable or totally off base? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en