[android-developers] Access user dictionary
I'm writing an InputMethod and trying to load the words from the user dictionary: Cursor cursor = getContentResolver().query(UserDictionary.CONTENT_URI, null, null, null, null); This line fails with the following exception: java.lang.IllegalArgumentException: Unknown URI content://user_dictionary What am I doing wrong? Peter -- 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: Access user dictionary
I figured it out. Instead of UserDictionary.CONTENT_URI, you need to use UserDictionary.Words.CONTENT_URI. Which makes me wonder why the UserDictionary class exists at all, since the only genuine piece of information it defines (the URI) isn't actually directly usable. Peter -- 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] Does anyone at Google read bug reports?
I've been developing for Android for about a year and a half. Whenever I encounter a problem, I dutifully file a bug report. I'm now up to about a dozen. Every single one of my reports is still listed as New in the bug tracker, even the ones filed a full 18 months ago. Not a single one of them has been fixed, closed, or even had anyone from Google add a comment to it. This is very discouraging. Does anyone who works on the OS actually read bug reports? Or am I just wasting my time, throwing them into a black hole? I want to help improve the OS, which is why I take the time to file bug reports, but my experiences so far haven't encouraged me to keep doing it. Peter -- 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: Flaky Touch Screen on Nexus One
The Nexus One doesn't have a very good touch screen. It wasn't designed for multitouch, by they (only partly successfully) hacked multitouch support into it. I find that I have to be a little careful how I hold the phone. If my hand touches the screen at the edge, that can confuse it and prevent touches elsewhere on the screen from being recognized correctly. Peter -- 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: What are the best 2D, 3D game engine for Android?
Here's a recent thread that discussed 2D game engines: http://groups.google.com/group/android-developers/browse_thread/thread/d54d5189309bf045/ad2513731f23aebe And this one discussed 3D game engines: http://groups.google.com/group/android-developers/browse_thread/thread/abafebc86bf44470/6c8df881876cf742 Peter -- 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: 3d engine advices
As a note; The game was better than I expected to see :). Thank you. :) You should consider using a different license though, LGPL and Android don't mix well due to the dex format Yes, other people have mentioned that to me. I'm planning to switch to BSD in the next version. And if you want to use it now, let me know and I'll go ahead and check in the changed headers on all the source files listing the new license. Peter -- 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: 3d engine advices
Another engine to consider is Gamine (http://sourceforge.net/projects/ gamine). I have some experience with it since, well, I wrote it. :) And I wrote Losing Your Marbles with it, if you want to see it in action. Peter -- 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] Low latency audio
How is low latency audio in Gingerbread supposed to work? It added the android.hardware.audio.low_latency flag to the manifest with the description, The application uses a low-latency audio pipeline on the device and is sensitive to delays or lag in sound input or output. But how do I actually use that low-latency audio pipeline? I've been unable to find any mention of it other than this flag. Peter -- 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: Renderscript documentation
Now that the 3.0 SDK is out, I've read through the Renderscript documentation. But it's pretty sketchy, and still doesn't answer most of my questions. Graphical scripts seem to consist of shader definitions and drawing code. But I assume the shaders ultimately get compiled down to the same machine code whether you define them with Renderscript or GLSL, and the drawing code presumably gets compiled down to roughly the same set of OpenGL calls that you'd make in Java or C++. So what are the advantages of using Renderscript instead? Then there are compute scripts, which I gather are meant to be a GPGPU framework? I have a lot of experience with CUDA and OpenCL, so I'd like to learn how it compares with those. There's hardly any documentation on writing compute scripts, and only a single trivial example. What threading model does it use? Does it support inter- thread communication? Scattered writes? Peter -- 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: opengl textures
Non-power-of-2 textures became a standard feature in OpenGL ES 2.0, so if you're using that, you can rely on them being supported. Peter -- 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] Renderscript documentation
Is there any documentation available for Renderscript? I downloaded the SDK docs, but aside from the Javadocs (which aren't very enlightening), it doesn't seem to be mentioned at all. What are the capabilities of Renderscript? When would it make sense to use it instead of OpenGL? Peter -- 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: Game Engine
That really depends on the type of game you're writing. I have an open source engine I've been developing: https://sourceforge.net/projects/gamine It could be a good choice for small to medium size 3D games. But if you want to write a 2D game, there's a completely different set of engines that are suitable for that. Peter -- 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: Upgrade to ADT 8.0.1: I knew I shoudn't have done it!
I didn't have to reinstall Eclipse, and it worked fine for me.* Peter * The word fine must be interpreted very broadly, given that the layout editor has actually managed to become even more buggy and painful to use than it was before (and that's an accomplishment). I've filed a bug report listing the issues I've found so far: http://code.google.com/p/android/issues/detail?id=13134. -- 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: Gamine 0.3 (3D game engine)
Do you have a suggestion for a different license? I don't want to create any obstacles to using it in commercial games, but I do want to make sure that if someone improves the library itself, those improvements will be released as open source. Ps: by the way I tried you game : it's nice but I think the difficulty slope is too big : I'm stucked in the third level ! Then try the fourth level. :) And you should give the option to remove the vibration... Good suggestion. I'll add that. Peter -- 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: Gamine 0.3 (3D game engine)
I don't think Apache requires people to release their improvements to the library? I'd prefer to have a license that does that. But if people object seriously to LGPL, and if I can't find a different one that does that, I'll probably just go to BSD, which imposes almost no restrictions at all. I failed too :) No comment. :) But I did just release an update with the setting for vibration. Peter -- 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] [ANN] Gamine 0.3 (3D game engine)
Gamine is an open source 3D game engine for Android. I've just released version 0.3, which incorporates lots of new features and bug fixes, and represents a large step forward in the overall maturity and robustness of the engine: http://sourceforge.net/projects/gamine Gamine has now been used in a commercial game (Losing Your Marbles), which gives me much more confidence in recommending it to other people for use in their games. So give it a try, and I'd be very grateful for any suggestions or other feedback. Peter -- 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: Gamine 0.3 (3D game engine)
It doesn't require you to release your source code. It just requires that you provide your application as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (That quote is from section 6a of version 2.1 of the license.) Relinking of compiled java code is easy to do. The only real restriction is that, if you run your code through an obfuscator, your have to leave the Gamine classes unobfuscated. Peter -- 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] Java 6 in Gingerbread?
Looking over the API change log for Gingerbread, it looks like it's moved from being based on Java 5 to Java 6. Anyway, I see lots of new classes and methods in the java.* packages that correspond to Java 6 features. There's no mention of this in the platform highlights document, though, and I would have expected a change as major as that to be prominently mentioned. Can someone who knows comment on this? Are the java.* packages now fully based on Java 6, or have only a limited subset of them been updated? Peter -- 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] Detect when the screen is locked
How can I detect when the screen is locked? I'm writing a game, and have found that sometimes users will pause the game by just hitting the power button to turn off the screen. onPause() gets called then as expected. But onResume() gets called as soon as they turn the screen back on, causing my game to start running again, even though it's hidden behind the lock screen. Calling getVisibility() on the View also returns VISIBLE, even though it isn't. How can I tell when my activity is actually visible, not hidden by the lock screen? Peter -- 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] Temporary files
As discussed in another thread (http://groups.google.com/group/android- developers/browse_thread/thread/d79bfa05528cbbee/2b08822eeb767b7b), my program allows users to export data by email. I do this by writing the data to a temporary file, then attaching it to an Intent: startActivity(new Intent(Intent.ACTION_SEND).setType(application/ vnd.mytype).putExtra(Intent.EXTRA_STREAM, android.net.Uri.fromFile(tempFile))); I've run into a difficulty with this approach, though: making sure the temporary file gets deleted when it isn't needed anymore. On most platforms, File.createTempFile() creates the file in a special location such as /tmp which ensures it will get deleted the next time the computer boots. Not so on Android: it just creates the file at the root level of the SD card, causing temp files to just build up and never get deleted. I tried to force it to get deleted by calling deleteOnExit(). No good: it still doesn't get deleted, presumably because Android apps never really exit, they just get suspended and then killed. So it looks like I need to manually delete the file when it's no longer needed. The question is, how can I tell when it's no longer needed? In this case, it's not a matter of when *my* program is done with it, but rather when the email client is done with it. Does anyone have suggestions for how to deal with this? Peter -- 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: How to get video to play in stock browser??
What type of file is it? I just tried to open a .mpg file both with the stock browser and with xScope. With xScope, it gave me the choice to play or download, but if I selected play, it gave me a message that no viewer was available. The stock browser didn't give me an option to play it, but was still able to download it without problem. (But once I had downloaded it, I still couldn't play it, again because no viewer was available.) Peter -- 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: Sharing data between users
I've been pushing ahead on this project. I'd like to report my progress for the benefit of anyone who comes across this thread. And perhaps someone can tell me if there's a better solution than what I'm doing. I'm trying to export data from my program in a way that users can easily share: emailing it, posting it on a website, etc. And when someone opens that file in their mail client, web browser, etc., I want my program to automatically open to import it. This requires me to identify the file as belonging to my program. With Android, there are two ways you can try to specify file types: by MIME type and by filename extension. Each of these only works in a minority of cases. By using both of them, you can cover a slightly larger set of cases, though still far from all cases. More on that later. The export side is quite easy. First, I create a temporary file with the proper filename extension: File tempFile = File.createTempFile(Export, .mytype); I write the data to that temporary file, then export it as follows: startActivity(new Intent(Intent.ACTION_SEND).setType(application/ vnd.mytype).putExtra(Intent.EXTRA_STREAM, android.net.Uri.fromFile(tempFile))); This works beautifully. It immediately opens the Gmail app to send an email and attaches my file to it. Presumably if I used a different email client that would be opened, though I haven't tested this. Now for the import side. I use the following intent filter to recognize files by MIME type: intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:mimeType=application/vnd.mytype/ /intent-filter When I open the email and press the Preview button next to the attachment, it opens my app just as I wanted. This only works as long as you have the MIME type associated with the file. If you post it on a website, that association gets lost. In that case we need to use filename extension: intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:scheme=http / data android:scheme=https / data android:scheme=ftp / data android:scheme=file / data android:scheme=content / data android:host=* / data android:pathPattern=.*\\.mytype / /intent-filter Now when I press the link in the Browser app, it brings up a list of applications to open the file with, mine being one of the options. That's not quite ideal, but it's good enough. Unfortunately, there are lots of other cases that don't work. Here's a really basic one: Open the email on your computer and save the attached file to disk. Now attach it to a new email. This causes the MIME type to be lost. When you open that email in the Gmail app, the Preview button is no longer there. It seems that when an attachment doesn't have a MIME type specified, the Gmail app doesn't let you do *anything* with. Not view it, not even save it to the sdcard, which is just ridiculous. That really needs to be fixed. Of course, what Android really needs is a way to define custom filename extension to MIME type mappings. Then this whole issue would go away. But as far as I can tell, there's no way to do that. Here's another case that doesn't work: view the email in the Browser using the Gmail web interface. The URL it provides to download the attachment doesn't include the attachment name, nor is the MIME type specified. Hence, you can't open it in my app. As a last resort, I plan to include an Import command in my app that instructs the user to save the file to their sdcard in /downloads, then load it from there. I'd feel better about that as a real solution if the Gmail app would actually let you save files to the sdcard. Peter -- 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] Sharing data between users
I'm writing a game that includes an editor for users to create their own levels. I'd like players to be able to share the levels they've created with other players. I'm trying to figure out the best way of implementing that, and hoping for any advice on the subject. One obvious option is to set up a server for sharing levels. The game would connect directly to the server to let players share their creations or download levels created by other players. This provides seamless integration and a good user experience, but I'd really prefer not to use this approach. For one thing, I don't want the cost and responsibility of setting up and maintaining the server. And I would be taking on a basically unlimited obligation; otherwise, if I decided to shut down the server a few years from now, the game would suddenly lose a large part of its value. Another idea I had is to use the Android Market as the way to distribute sets of levels. That way, Google is taking care of running the server for me. Clearly there are programs that work this way, since I've seen lots of themes and expansion packs for particular applications in the Market. While this could work, I'm not very happy with it. Asking an ordinary user to sign up for a developer account on the Market and learn how to post files through it is unreasonable, not to mention they would have to pay $25. The approach I'm currently leaning toward is allowing levels to be exported as ordinary files. People could then just email them to each other, post them on any website they wanted, etc. Ideally I would want to set up a file type association so they could simply open an email attachment or click a link in the web browser, and my game would automatically be launched to import it. I haven't yet looked into whether that's possible. Has anyone else done something similar to this? It seems like a fairly common sort of problem. What approach did you decide on? Do you have any advice on how to proceed? Thanks! Peter -- 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: Full screen activity
Thanks. With that change it's better, but still not quite right. Let me try to describe exactly what I'm seeing. My layout consists of a GLSurfaceView that fills most of the screen, and some buttons at the bottom. The hierarchy is as follows: LinearLayout1 GLSurfaceView LinearLayout2 Button1 Button2 ... When I first run the activity, it comes out basically correct. That is, it lays out the view the size of the full screen, but pushed down by the height of the notification bar so the buttons are sticking off the bottom. But you only see that for a fraction of a second. Then the notification bar slides off, and the view slides up to fit the screen. All is good. Now I hit the Home button to return to the home screen. Then I hold down Home to get the list of recent applications and select mine. This time things get drawn differently. When the notification bar slides off, the GLSurfaceView slides up to the correct place. And the buttons slide up within LinearLayout2. But the bounds of LinearLayout2 do NOT get updated. So I'm left with a gap between the GLSurfaceView and the buttons, and the top half of the buttons get cut off. Does that make sense? Peter -- 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: Full screen activity
Yes, this is on 2.2. I'll file a bug. Thanks. Peter -- 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] Full screen activity
I'm writing an Activity that should take up the entire screen. I therefore call requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); at the beginning of onCreate(). But it doesn't work correctly. What happens is that the window title and notification bar are both visible for just a moment when the activity starts up. Then they slide off, leaving my activity with a messed up layout: a blank space the size of the notification bar gets left at the top of the screen, and a little bit of my layout gets cut off at the bottom of the screen. It appears that it's laid out the activity the size of the full screen, but then pushed it down a bit so part of it gets cut off. If I remove either one of the two lines above, everything works correctly and nothing gets cut off. But then I have a title bar or notification bar at the top of the screen, which I don't want. I'm sure I must be missing something simple, but I've had no success figuring out what. Peter -- 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: Adding library to Eclipse project
Thanks. Putting it in libs also seems to work. Peter -- 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] Adding library to Eclipse project
I'm clearly missing something simple, but after nearly an hour of trying to figure it out, I'm still stuck. I have an external jar file containing classes I want to use in my project. No problem, right? I just followed the instructions at http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary That is, I used the Properties-Java Build Path-Libraries panel to add the jar to my project as a library. But it doesn't work. The external library is being included in the compilation classpath, so everything compiles correctly, but the external classes aren't actually getting included in the apk. When I try to run my app, it immediately crashes with a java.lang.NoClassDefFoundError. And looking at the apk, I see it's only 20K, whereas the external library jar is over 200K. What am I doing wrong? Peter -- 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: Adding library to Eclipse project
Thanks, that worked. It appears that the developer documentation page cited above is incorrect. It explicitly says, It is not necessary to put external JARs in the assets folder. Peter -- 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] Using targetSdkVersion
I'm stuck on a problem that I'm sure has a very simple answer, but I haven't been able to figure it out. I have a program that should work on Android 1.5, but when it's run on newer devices with higher resolution screens, it should support the full resolution and not emulate a lower resolution screen. As far as I can tell from the documentation, this should be simple. I just specify uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4/ The problem is that if I tell Eclipse to compile for 1.5, it refuses to accept this. It reports an error (targetSdkVersion is an unknown tag) and refuses to compile or run. If I tell it to compile for 1.6 it works fine, of course. But if I then try to install on a 1.5 AVD, the program immediately crashes with a java.lang.VerifyError. I'm clearly missing something simple. How do I get it to compile an apk that works under 1.5, but still includes the targetSdkVersion tag? Peter -- 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: Using targetSdkVersion
You're right, my fault. Because I had Eclipse set to 1.6, I missed the fact that I was calling an API that didn't exist in 1.5. Thanks! Peter -- 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: Game Stuttering
I've also seen this sort of stuttering, which in my case is clearly related to gc, since a message appears in the log saying that a gc was just done whenever it happens. I've used DDMS to identify where garbage is being produced, and have completely eliminated all allocations in my own code. By I'm still seeing allocations in code internal to Dalvik itself, and I haven't found any way to get rid of them. Peter -- 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: Calculate Time Elapsed
The number of seconds elapsed is just timePassed/1000. You're trying to make it more complicated than it really is. Peter -- 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: Turning off the screen
Thanks. It's good to know this works on at least some phones. So I guess I'll just provide a user setting for whether to turn the screen off or not, so those whose phones don't have this problem can still save power. And I'll file a bug report. Now I'm running into the problem that even SCREEN_DIM_WAKE_LOCK doesn't really work. It keeps the phone on for a little while, but within a few minutes after the regular screen timeout, it invariably turns completely off. Sigh. I get the feeling that wake locks are a half implemented feature. I suppose I'll try just calling PowerManager.userActivity() every few seconds to prevent that, then manually dimming or turning off the screen by setting screenBrightness. Peter -- 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: Turning off the screen
Looks like this is already a well known issue with a lot of people complaining about it: http://code.google.com/p/android/issues/detail?id=3708 Peter -- 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] Turning off the screen
I'm writing a program that processes SensorEvents. It needs to keep running and keep processing events even when the user isn't directly working with their phone (i.e. when it's just sitting in their pocket). To make that work, I need to prevent the phone from turning off. On the other hand, I don't want to waste power unnecessarily, so I don't want to prevent the screen from turning off. Looking at the documentation, it seems that a WakeLock of type PARTIAL_WAKE_LOCK should do exactly what I want. But it doesn't work: as soon as the screen turns off, my program stops running (or at least onSensorChanged() stops getting called). If I instead use a lock of type SCREEN_DIM_WAKE_LOCK, everything works as expected and my program keeps running. But then the screen stays on (although dimmed), which is far from ideal. I then thought maybe I could just turn off the screen myself by setting WindowManager.LayoutParams.screenBrightness to 0. But no... as soon as I do that, my program stops running. It appears that set the screen brightness to 0 is actually interpreted as turn off the phone! Is there any way I can make the display turn off while still allowing my program to keep running? Peter -- 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] Gamine game engine 0.2
I've just released version 0.2 of Gamine, an open source 3D game engine for Android devices: https://sourceforge.net/projects/gamine This release adds lots of major features, including particle effects, OBJ file import, picking, text rendering, transparent rendering, and more. Although it's still a very early version, I believe it is now complete enough to be used for real games. So give it a try, and I'd really appreciate any feedback about it. Peter -- 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: Gamine game engine 0.2
On Apr 29, 3:01 pm, AS aurillia...@gmail.com wrote: how long has gamine been around? Let's see... I came up with the idea on Dec. 25. (I had lots of time for thinking about it while sitting in the car on the way to and from Christmas dinner.) So I started reading Android developer documentation, downloaded the SDK on Dec. 31, wrote the first line of Gamine code on Jan. 1, ordered a Nexus One about a week after that, and released version 0.1 in late February. So she's still a young thing. :) but because it didn't utilise the NDK it was far, far too slow. I'm doing everything in Java, but I haven't found performance to be a problem, at least on my N1. The graphics is all OpenGL, of course, and the most important thing for performance is not to do any object allocation at times when you care about speed. And of course you need to choose algorithms carefully. But I've been doing 3D for a long time, and I write physics engines for a living, so I have a pretty good background on how to do that. Which isn't to say that I'm not eagerly waiting for the Dalvik JIT to be released. :) Can you give me any more details? Are there demo apps yet? There are several examples included when you download it. They're more targeted at showing you how to use it than showing off what the engine can do, but they still do the latter to some extent. In terms of features, the main elements are rendering, physics, and infrastructure. Rendering includes scene graph management, lighting, texturing, mesh creation, etc. Physics currently means rigid body simulation, including contact modeling and collision detection. Infrastructure includes running the event loop, managing input, and things like that. I can go into more detail about any of these you're interested in. Peter -- 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] Gamine game engine
Gamine is an open source 3D game engine for Android devices. I've just released version 0.1. This is still a very early version, so you probably won't be creating any masterpieces with it just yet, but I'd very much appreciate any feedback on the overall design and architecture. https://sourceforge.net/projects/gamine/ A few notes on compatibility. I've written it using the Android 2.0.1 SDK. I don't know for sure that it won't work with earlier versions, but I haven't tested it, and I've made no effort to support earlier versions. Also, it assumes that certain features of OpenGL ES 1.1 are supported: texture combiners, automatic mipmap generation, and vertex buffer objects. Of course, I really ought to check whether the appropriate extensions are supported and fall back to other methods if they aren't, but I don't know if that's necessary. Does anyone know of any devices (particularly devices that support Android 2.0 or later) that do NOT support those features? Peter -- 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] Vertex arrays vs. VBOs
I was wondering if anyone has experience with the relative performance of vertex arrays vs. vertex buffer objects? On a desktop computer, you expect VBOs to be much faster since the data can be stored in video memory. But hand held devices don't usually have separate video memory, so I'd expect little or no difference between them. How do they actually work in practice? Peter -- 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: Events on GLSurfaceView
Here is where I create and add the listener: http://gamine.svn.sourceforge.net/viewvc/gamine/trunk/src/net/sf/gamine/common/InputStage.java?revision=8view=markup It gets added in onStart(), which is called from the start() method of http://gamine.svn.sourceforge.net/viewvc/gamine/trunk/src/net/sf/gamine/common/Sequence.java?revision=8view=markup I just tested calling setFocusable(true) again to be sure. As before: I still don't get key events, and the Back and Menu buttons stop working. If at all possible, I'd really prefer not to do event handling at the Activity level. This is a library (a 3D game engine), and I don't want to restrict how developers create their Activities. They just need to provide a suitable View for the library to work with. Peter -- 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: Events on GLSurfaceView
Got it! In the process of messing around with this, I think I had actually done all things I needed to, just never in the right combination. For the record, the essential elements were: 1. Call setFocusable(true) on the View 2. Call setFocusableInTouchMode(true) on the View 3. Return false from onKey() With those elements, it's now working. Thanks so much for your help! Peter -- 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: Events on GLSurfaceView
On Jan 16, 3:27 pm, Robert Green rbgrn@gmail.com wrote: Remember to call setFocusableInTouchMode(true); in the view if you want to receive focus and key/touch events. I wasn't doing that. I just tried it though, and it didn't fix the problem. Instead, it disabled the Back and Menu keys... Peter -- 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: Definition of SensorEvent rotation angles
On Jan 16, 1:40 pm, Lance Nanek lna...@gmail.com wrote: Do you have a phone? Just log the values and look at them as you move the phone. Yes I've done that, but it's not obvious from that which of the 24 possible rotation sequences it's using (six possible axis orders, and the second and third rotations can each be around either a transformed or untransformed axis). If you're able to tell just by looking at numbers as you tilt the phone around, your intuition for composite rotations is far better than mine! Peter -- 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: Events on GLSurfaceView
On Jan 16, 1:19 pm, Philip philip.dese...@gmail.com wrote: Not sure why this would happen but if you want to take a look at the cocos2d for Android code I released last night, there are a few examples on how it works. Thanks, that was really helpful. After looking through your code for a while and comparing it to mine, I spotted a mistake I was making. Having fixed that, I'm now receiving touch events. Yay! I'm still not getting any KeyEvents. I should mention that my phone doesn't have a physical keyboard, so I've been using the on-screen keyboard. I assumed that would generate KeyEvents, but maybe that was a bad assumption? On the other hand, it doesn't work with the emulator either. Also, the first time I hit a key, the following message appears in the log: 01-16 16:50:16.547: WARN/KeyCharacterMap(2440): No keyboard for id 65540 01-16 16:50:16.547: WARN/KeyCharacterMap(2440): Using default keymap: / system/usr/keychars/qwerty.kcm.bin That's for the phone. For the emulator, the message is identical except the first line says id 0 instead of id 65540. Could this be related to the problem? Peter -- 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] Definition of SensorEvent rotation angles
I'm trying to figure out exactly how to interpret the rotation angles produced by a SensorEvent for Sensor.TYPE_ORIENTATION. Unfortunately, the documentation (http://developer.android.com/reference/android/ hardware/SensorEvent.html#values) doesn't give a complete definition of it. It defines what the axes are, but doesn't specify what order the three rotations are applied in, nor whether the later rotations are around transformed or untransformed axes. Without knowing that, it's impossible to know what the actual rotation is that's being described. How can I find out what the event values actually mean? Peter -- 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: OpenGL fixed point vs. floating point
Just render a small object using identical code except one is float and one is int, then time them. Unless a garbage collection happens to kick in during one of those tests, or the OS decides to timeslice to another process, or the JIT decides to recompile some code with better optimization, or any of the other things happens that makes timings nondeterministic. Peter -- 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: OpenGL fixed point vs. floating point
That looks like a lot of interesting and useful performance information, but I didn't actually see any answers to my questions there. In fact, the only discussion of fixed point versus floating point was in relation to a physics algorithm. I don't have questions about my physics code, because I'll be writing it myself. :) It's the behavior of OpenGL that I don't know about. Perhaps I would do better to ask a slightly different question: how can I determine whether the device my program is running on has hardware floating point support? Peter -- 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: OpenGL fixed point vs. floating point
First you need to find exactly what kind of CPU it has. Then go to the manufactures web site and download the docs on programming there 3d Well, yes, but I didn't mean manually. What I meant is, is there an API by which I can determine whether the device my program is running on has hardware floating point support? The idea is that I want to implement both floating point and fixed point versions of my rendering code, then chose which one to use at runtime based on the hardware it's running on. Peter -- 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] OpenGL fixed point vs. floating point
OpenGL ES allows values to be specified in either fixed point or floating point format, but I haven't been able to find any information about how this is actually implemented on Android devices. Are there actually two different pipelines, one for fixed point and one for floating point? If so, what happens if you mix and match them, such as specifying your matrix in floating point but your vertices in fixed point? Alternatively, does it implement everything with just one format internally, and convert the other format to it as necessary? If so, then you presumably get the best performance if you always specify values in the internal format so as to avoid conversions. How then can I determine which format is used internally? I notice that the Matrix and Visibility classes only accept floating point values for matrices. Should I interpret that as a recommendation to use floating point for matrices? Peter -- 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