[android-developers] Re: Issue with Threads and onCreate()
That will solve the problem when opening/closing the keyboard, but won't solve it when e.g. starting the app and then immediately hitting the back button to exit it. On Wed, Mar 11, 2009 at 5:37 AM, Stoyan Damov stoyan.da...@gmail.com wrote: keyboardHidden|orientation On Wed, Mar 11, 2009 at 2:34 PM, mobilekid mobilek...@googlemail.com wrote: For some reason that seems not to work in my case. I've declared the activity as android:configChanges=orientation in the AndroidManifest.xml, which I assume will call onConfigurationChanged (Configuration). So for testing purposes I've simply implemented it as follows: @Override public void onConfigurationChanged (Configuration newConfig){ Log.i(this.toString(), I've been called!); super.onConfigurationChanged(newConfig); } However, it never gets called. Am I doing anything wrong here?! Thanks! On Mar 11, 11:44 am, Stoyan Damov stoyan.da...@gmail.com wrote: Yes, basically if you declare your activity's orientation to be sensor there's nothing else to do (I think). --~--~-~--~~~---~--~~ 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: Issue with Threads and onCreate()
Sure, but then what if right as the activity is starting, something else happens that causes it to be destroyed? (incoming phone call, camera app is started, it could be anything, really) My point was: instead of putting in all these hacks to try and prevent your activity from being stopped and restarted at an inconvenient time, it's ultimately easier to do the right thing. Like cleaning up the threads in onDestroy, using a service instead of a thread, or keeping the threads across activities. On Wed, Mar 11, 2009 at 7:18 AM, Stoyan Damov stoyan.da...@gmail.com wrote: unless he traps the back button in onKeyDown On Wed, Mar 11, 2009 at 2:51 PM, Marco Nelissen marc...@android.com wrote: That will solve the problem when opening/closing the keyboard, but won't solve it when e.g. starting the app and then immediately hitting the back button to exit it. On Wed, Mar 11, 2009 at 5:37 AM, Stoyan Damov stoyan.da...@gmail.com wrote: keyboardHidden|orientation On Wed, Mar 11, 2009 at 2:34 PM, mobilekid mobilek...@googlemail.com wrote: For some reason that seems not to work in my case. I've declared the activity as android:configChanges=orientation in the AndroidManifest.xml, which I assume will call onConfigurationChanged (Configuration). So for testing purposes I've simply implemented it as follows: @Override public void onConfigurationChanged (Configuration newConfig){ Log.i(this.toString(), I've been called!); super.onConfigurationChanged(newConfig); } However, it never gets called. Am I doing anything wrong here?! Thanks! On Mar 11, 11:44 am, Stoyan Damov stoyan.da...@gmail.com wrote: Yes, basically if you declare your activity's orientation to be sensor there's nothing else to do (I think). --~--~-~--~~~---~--~~ 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: The specified child already has a parent. You must call removeView() on the child's parent first.
It would help if you posted the stack trace for the exception, and the code that triggers it. On Sun, Mar 15, 2009 at 7:18 AM, gsmd gsm...@gmail.com wrote: This is the IllegalStateException thrown from onCreate() that brings the main activity of my app down upon restart (e.g. launch app - hit back - launch again - got it). Could someone elaborate on what does this exception mean? --~--~-~--~~~---~--~~ 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: Is it normal to play an audio during phone call?
A MediaPlayer object will not pause when a call comes in. You'll have to do that yourself. The original poster was talking about switching the screen to MediaPlayer, so I assumed he was talking about the 'Music' application, which *does* pause. On Mon, Mar 16, 2009 at 1:35 PM, Jason Van Anden jason.van.an...@gmail.com wrote: MediaPlayer keeps playing after I answer a call using my app. I was assuming that I was responsible for pausing it and was planning to figure out how this might be done (like, which intent I am listening for). Is the MP supposed to just pause automatically? i++ On Mon, Mar 16, 2009 at 4:08 PM, Marco Nelissen marc...@android.com wrote: The music player will automatically pause when a call comes in, however if you then decide to resume playback while you're in the call, that's your choice, and we won't prevent you from doing so. On Sun, Mar 15, 2009 at 8:16 PM, roger fang new...@gmail.com wrote: Hi all, When you pick up the call and switch the screen to MediaPlayer to play an audio, it is able to be heard from handset (receiver). Thus, you can hear the far-end voice and your local music at the same time. Is it a normal behavior? Android seems not to have the mechanism to let Mediaplayer to remember its status (to keep music pause or mute?) in the phone call. Or this is a normal design for notification sounds, such as a call- waiting sound? Is it possible to have an secondary gain feature like windows mobile in the future? Thanks. roger --~--~-~--~~~---~--~~ 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: is there an andriod simulator?
The emulator is included in the SDK. On Tue, Mar 17, 2009 at 3:09 PM, ytbryan ytbr...@gmail.com wrote: hi all, may i know is there an andriod simulator ? like how the iphone simulator works? thank you regards bryan --~--~-~--~~~---~--~~ 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: a way to make signal processing
On Tue, Mar 17, 2009 at 4:09 PM, Maisonobe.A (MaaKs) alexma...@gmail.com wrote: Hello, I'm looking for a way to work on sound . I would need to get the mic input as raw data and to perform some test , is there a way to get raw sound data ? No, not currently. --~--~-~--~~~---~--~~ 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: Simple Cursor Adapter - List View
You should create your own adapter (probably derived from SimpleCursorAdapter) that does this in its bindView method. On Tue, Mar 17, 2009 at 11:57 PM, Markiv vikramshe...@gmail.com wrote: I have table with 3 columns which is binded to an XML document with three text views. String[] from = new String[]{A,B,C}; int [] to = new int[] {R.id.a,R.id.b,R.id.c}; Where R.id.a, R.id.b, R.id.c - TextView Depending on the value store in the third column, I want to change the text color in R.id.c How should, I go about with this. This is what I have so far : SimpleCursorAdapter entry = new SimpleCursorAdapter(this, R.layout.addrow, vCursor , from , to); setListAdapter(entry); If you can provide me an example, that would be really helpful. --~--~-~--~~~---~--~~ 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: Re-register AlarmManager events on upgrades
On Wed, Mar 18, 2009 at 3:47 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Mar 18, 2009 at 4:36 AM, Dianne Hackborn hack...@android.com wrote: Fwiw, cupcake will add a new field to PACKAGE_ADDED to tell you if this was due to an update, and allow this broadcast to be received by the app to restart itself. This cupcake thing very much reminds me of Duke Nukem Forever... Really? You think Cupcake is not going to ship in the next 12 years? --~--~-~--~~~---~--~~ 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: Problems with NotificationManager
Just use a different Intent for each of your notifications. On Wed, Mar 18, 2009 at 4:03 AM, mobilek...@googlemail.com mobilek...@googlemail.com wrote: Hi, In my app I use several different notifications, which require different actions. By default the notification manager loads the main activity, when users select a notification. How can I change that so different notifications prompt different actions. I've been studying the related APIs, however, could not find a way of detecting which notification a user has selected. Any thoughts? 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: MediaPlayer and onRetainNonConfigurationInstance()
You will have to handle the orientation change yourself, since otherwise the surface that the video is displayed on goes away. On Wed, Mar 18, 2009 at 11:30 AM, Andres Calvete andres.calv...@gmail.com wrote: I know this question has been asked previously because I have read the other postings over a hundred times but yet I cannot come up with an answer on how to use keep a MediaPlayer object playing over an orientation change. I've read that you can use onRetainNonConfigurationInstance() to pass an object to your future self when the activity is destroyed/recreated, but I can't keep a video playing in this circumstances. Does anybody have an example or an advice/guide on how to do this? or rather what do I pass on onRetainNonConfigurationInstance() to keep the video playing after an orientation change? 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problem launching my own (camera) application on press of Camera-button
Try calling abortBroadcast() in your receiver. On Thu, Mar 19, 2009 at 7:18 AM, Streets Of Boston flyingdutc...@gmail.com wrote: When i press the phone's camera button, both my application and the system's camera application are launched: - I press camera button - After a few seconds, my camera app appears and all looks good. - However, when i go back (back-button), i'm not brought back to where i was before. Instead, i'm brought (back) to the system's camera application. It looks like both camera apps are launched: The system's camera app is launched and on top of that my camera app is launched. I expected the activity-chooser to appear asking which camera app i'd like to start (with an option of making one the default). Here are some code snippets: Manifest: receiver android:name=.camera.CameraReceiver intent-filter action android:name=android.intent.action.CAMERA_BUTTON/ /intent-filter /receiver activity android:name=.camera.SmugCamera android:label=@string/app_name android:screenOrientation=landscape android:icon=@drawable/ camera android:clearTaskOnLaunch=true android:taskAffinity=smugdroid.task.camera intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.LAUNCHER / /intent-filter intent-filter action android:name=android.media.action.IMAGE_CAPTURE / category android:name=android.intent.category.DEFAULT / /intent-filter /activity CameraReceiver.java: public void onReceive(Context context, Intent intent) { KeyEvent event = (KeyEvent) intent.getParcelableExtra (Intent.EXTRA_KEY_EVENT); if (event == null) { return; } Intent i = new Intent(Intent.ACTION_MAIN); i.setClass(context, SmugCamera.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } Do i have to change the onReceive method to use Intent.createChooser (...) instead? Or is there some other problem i'm not aware of? Thank you. --~--~-~--~~~---~--~~ 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 a complete list of android native drawables
On Fri, Mar 20, 2009 at 7:42 AM, Mark Murphy mmur...@commonsware.com wrote: That list is... very questionable. It contains lots and lots of resources that are not in the public SDK, and which you should not be using. Then how about pointing us to a list that isn't questionable? Or at least show us where to find said information and we'll draw up a list. Agreed. For example, one would hope we are encouraging people to use the stock option menu icons wherever possible, for consistency between applications. On the other hand, you might be better off using your own copy of the system icons. For example, if you were to use system icons plus some additional ones in the same style that you made yourself, your application's menus will look weird if the system icons are redesigned. --~--~-~--~~~---~--~~ 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 check if there are registered broadcast listeners?
On Sun, Mar 22, 2009 at 5:28 AM, Yuriy Olkhovyy y.olkho...@gmail.com wrote: Is there a way to check before sending a broadcast (from a remote service) whether there are registered broadcast listeners? What I'd like to do is to send broadcasts only if there are registered listeners, otherwise make a toast. Does it make any sense? Will there be more than one broadcast receiver? If not, then an easy way to do this would be to add another broadcast receiver with a low priority, so that it receives the (ordered) broadcast last, and then have that receiver pop up a toast. The other receiver should call abortBroadcast() in that case to prevent the final receiver from receiving the broadcast. --~--~-~--~~~---~--~~ 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: Cupcake coming in April? Where is the SDK?
I certainly hope there aren't a lot of applications that use reflection and private APIs. On Mon, Mar 23, 2009 at 6:59 AM, zl25drexel zl25dre...@gmail.com wrote: Cupcake is coming, and as you know it will break a lot of apps in the market, those that use reflection private api. So where is the Cupcake SDK/emulator for us to try our apps? I know we can download the source codes and build it, and I know apps wont break if they dont use undocumented api, blah blah blah, but we should get an official SDK/emulator for cupcake, dont you think, google? --~--~-~--~~~---~--~~ 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: ProgressBar - Emulator not working?
Try adding this to your xml: style=?android:attr/progressBarStyleHorizontal On Mon, Mar 23, 2009 at 9:50 AM, droozen droozenr...@gmail.com wrote: I just wanted to run a ProgressBar test, as it's my first time using them on the Android. Here's my XML (in a Linear Layout): ProgressBar android:id=@+id/progress android:layout_width=fill_parent android:layout_height=25dip android:indeterminate=false android:max=100 android:progress=50 / When I run the emulator I get a progress bar that glows orange on the left and right end. I also instead tried programmatically setting indeterminate to false, max to 100, and progress to a solid 50. No go. I even tried creating a background worker thread that would update the progress of the bar every half a second. Nothing. I just get two glowing orange ends to my bar (with a blank space in the middle). Is this a problem with the emulator? Or am I doing something wrong with the ProgressBar? --~--~-~--~~~---~--~~ 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 show my ProgressBar
The problem is that your 'backgroundWork() method is not actually running in the background, but in the main UI thread. You'll need to do the work in a separate thread. On Tue, Mar 24, 2009 at 8:02 PM, guishenl...@gmail.com guishenl...@gmail.com wrote: I want to show a ProgressBar while doing some background operation, but my code seems not to work. I hope someone can help me to solve this problem. Thank you in advance!Here is my code and explanation : public boolean onMenuItemSelected(int featureId, MenuItem item) { switch(item.getItemId()) { case CASEONE_ID: ProgressBar progress = (ProgressBar)findViewById (R.id.ProgressBar); progress.setVisibility(View.VISIBLE); progress.bringToFront(); progress.invalidate(); backgroundWork(); progress.setVisibility(View.GONE); progress.invalidate(); return true; } return super.onMenuItemSelected(featureId, item); }/*In fact I never see the progressbar by this code, instead the program will keep frozen until backgroundWork() finish. But what I want is the progressbar can appear in the screen while backgroungWork () is being processed. private void backgroundWork(){ for(int i=0;i1E8;i++); }/*This is not the exact work I did in my own program. I change it to this form is just to tell you my operation will occupy the processor for long time.*/ --~--~-~--~~~---~--~~ 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: MediaPlayer fails with LocalSocket
The file descriptor used for a MediaPlayer must be seekable, which a socket is not. On Tue, Mar 24, 2009 at 3:22 AM, Pawel Defee pawel.de...@gmail.com wrote: Trying to set a file descriptor originating from a LocalSocket on a MediaPlayer fails in Android, both the SDK emulator and the actual devices. This problem was originally described in the link below, but the discussion got (unfortunately) sidetracked: http://groups.google.com/group/android-developers/browse_thread/thread/6cf46cf5d1c8af45 The link gives example code to reproduce the problem - I am listing the necessary steps here as well for reference: 1) Create a thread with a LocalSocket that receives raw audio data (e.g. an OGG file), for example from another LocalSocket. 2) Connect the socket and a new MediaPlayer using mediaPlayer.setDataSource( receivingSocket.getFileDescriptor()); The code will fail with UNKNOWN_ERROR on C side with the following exception on Java side: java.io.IOException: setDataSourceFD failed: status=0x8000 at android.Media.MediaPlayer.setDataSource(Native Method) at android.Media.MediaPlayer.setDataSource(MediaPlayer.java:251) I studied the C implementation of MediaPlayer APIs, but could not find out why the method MediaPlayer::getMediaPlayerService fails to return a valid media player service in this particular case. Thanks in advance for any help, Pawel --~--~-~--~~~---~--~~ 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: All SYMBIAN based end devices accept Java language Applications :: Need Clarification
On Wed, Mar 25, 2009 at 9:30 AM, Zhubham sahilz...@gmail.com wrote: “All SYMBIAN based end devices accept Java language Applications” (i) Does this mean that the applications made for Android would run in S60 , without any modifications?? No. (ii) If not then what exactly we mean when we say the above statement?? Is there any web link to which I can refer to?? You would have to ask the author of that comparison what s/he meant. (iii) What are the coding guidelines that we need to follow so that an Android application can be ported on S60 with minimum changes?? I know nothing about S60, but I imagine that keeping your UI code separate from the rest of the code would be a good first step towards portability to other platforms. --~--~-~--~~~---~--~~ 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: TERRIBLE BUG: aapt crashes on Windows
On Wed, Mar 25, 2009 at 3:38 PM, Stoyan Damov stoyan.da...@gmail.com wrote: This is a showstopper, and I'm experiencing for the 2nd time. Shouldn't be hard to find, if the apt tool developers have created a .map file for the release build. It seems like the dev has dereferenced a null pointer (see below). 012FA000 is not null :) Are you using any ninepatches with a large number of stretch regions, by any chance? If so, that bug has already been reported and is fixed in cupcake. --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
On Fri, Mar 27, 2009 at 2:35 AM, Al Sutton a...@funkyandroid.com wrote: Or an Exclusive app and App that can pause exclusive app pair of permissions. If you really want to make this user friendly the settings page could allow users to select which apps with the App that can pause exclusive apps permission actually can pause the exclusive app That doesn't strike me as user friendly at all. --~--~-~--~~~---~--~~ 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: Some stacktraces do not show up in logcat output
All uncaught exceptions are logged. The library you are using is probably catching them at a different level, preventing them from showing up in the log. On Sun, Mar 29, 2009 at 4:14 PM, Dirk Jaeckel dirk.jaec...@gmail.com wrote: Hi! Usually I can see the exceptions that are thrown in my application via adb logcat. But they seem to get lost when thrown by code running in a somehow different Thread. I use the Smack Library to receive XMPPMessages. When the receiving thread throws a NullPointerException that is not logged. I can catch it myself and log it with android.util.Log. Is it possible to have logcat show all stacktraces from all exceptions thrown in all Threads? Regards, Dirk --~--~-~--~~~---~--~~ 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: can i add a click listener to a drawable?
Your Drawable itself is not part of the UI, but is drawn onto something that is part of your UI. Therefore, you should attach your listener to the UI object that displays the Drawable. See also http://developer.android.com/reference/android/graphics/drawable/Drawable.html, which says Unlike a View, a Drawable does not have any facility to receive events or otherwise interact with the user. On Sun, Mar 29, 2009 at 10:24 PM, Josh joshdo...@gmail.com wrote: I currently have a drawable and i need to know when it's clicked. Is there a way to add an event listener to a drawable? I realize that there may be a better control to use for me needs so I tried ImageButton but Im a bit confused on how to position the ImageButton. For example whe i position the drawable i just use setBounds. Is there a way to specify the x and y coordinates for an image button? --~--~-~--~~~---~--~~ 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: Android game developers desperately need optimised game engine example code ...
On Mon, Mar 30, 2009 at 2:14 AM, admin.androidsl...@googlemail.com admin.androidsl...@googlemail.com wrote: Thanks for the response. Side scrolling is a very commonly used game engine and I believe that the platform needs better examples of this. Obviously other graphic engines are needed too, e.g. OpenGL - but I think getting good performance out of 2d graphics will be a very good start for many games. Compare the smooth scrolling in GridViews with say the scrolling in a paid game like deBlob (very jerky - see for yourselves) to see what I mean. What makes you think that the reason GridView is smooth and deBlob is jerky is because of magic in GridView, and not because of bad coding in deBlob? --~--~-~--~~~---~--~~ 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: Android game developers desperately need optimised game engine example code ...
Unless you're trying to build your side-scroller using multiple nested layouts and dozens of textviews, it's completely irrelevant. On Mon, Mar 30, 2009 at 9:45 AM, Sundog sunns...@gmail.com wrote: I find this more depressing than otherwise. So whoever wrote those views wasn't happy with the system's response either and had to optimize. Doesn't bode well for the side-scrollers. On Mar 30, 10:07 am, Romain Guy romain...@google.com wrote: GridView and ListView don't use any magic. They just do whatever they can to make things fast: - When you touch the screen, all the children are turned into bitmaps - When a child is turned into a bitmap, it's an opaque bitmap whenever possible (ListView reuse the background color of the window) - When you move your finger around, the bitmaps are simply moved - When a new child appears, it's turned into a bitmap, etc. ListView actually does quite a lot of things when you scroll 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: can i add a click listener to a drawable?
You might want to look at the source code for the camera app, which uses a SurfaceView for its preview, and puts controls on top of it. On Tue, Mar 31, 2009 at 9:21 PM, Josh Dobbs joshdo...@gmail.com wrote: I am using in ImageButton Now and am using the following code to ad the button to the surfaceview.. myImgTest .setBackgroundDrawable(mBalloon1); myImgTest.draw(canvas); This seems to work as I do not get any errors however i don't see the button. What is the proper way to add the button to the surface view and how do I specify cordinates? On Sun, Mar 29, 2009 at 11:41 PM, Marco Nelissen marc...@android.comwrote: Your Drawable itself is not part of the UI, but is drawn onto something that is part of your UI. Therefore, you should attach your listener to the UI object that displays the Drawable. See also http://developer.android.com/reference/android/graphics/drawable/Drawable.html , which says Unlike a View, a Drawable does not have any facility to receive events or otherwise interact with the user. On Sun, Mar 29, 2009 at 10:24 PM, Josh joshdo...@gmail.com wrote: I currently have a drawable and i need to know when it's clicked. Is there a way to add an event listener to a drawable? I realize that there may be a better control to use for me needs so I tried ImageButton but Im a bit confused on how to position the ImageButton. For example whe i position the drawable i just use setBounds. Is there a way to specify the x and y coordinates for an image button? --~--~-~--~~~---~--~~ 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: MediaPlayer sluggish to play sounds
I'm surprised that calling start() has no effect, and that it takes several seconds for playback to work again. Do you have the same issue when playing a file in the music player, for example? On Tue, Mar 31, 2009 at 5:35 PM, Eric M. Burke burke.e...@gmail.com wrote: I have an Activity that plays a brief OGG pop sound effect when bubbles pop. To keep it fast and to ensure I can play several pops, I create four MediaPlayer instances. I synchronize access to a pool of instances, so I can play up to four pops at once. Once a sound completes, I call seekTo(0) and return the MediaPlayer instance to my pool. Here is a rough sketch of the code: // when the activity resumes... for (int i=0; i4; i++) { MediaPlayer mp = MediaPlayer.create(context, R.raw.pop); mp.setOnCompletionListener(this); mp.setVolume(1f, 1f); players.add(mp); // put into a pool of available players } // when a bubble pops... MediaPlayer mp = ...get player instance from the pool if (mp != null) { mp.start(); // works! plays the pop sound } // implement the OnCompletionListener interface public void onCompletion(MediaPlayer mp) { // seek to the start so I can play the sound fast the next time mp.seekTo(0); return the MediaPlayer to the pool } Here is the problem. The pops all work so long as my game is active. But if I let it sit there for just a few seconds, I see this in the LogCat console: (on my G1 phone) AudioHardwareMSM72xx Going to standby Once this happens, the next several calls to MediaPlayer's start() method play nothing...but they do cause the audio hardware to wake up again, so then my sounds eventually (after a few seconds) start playing again. My question is, how do I prevent the AudioHardwareMSM72xx from going to standby mode while my Activity is active? One hacky idea...I could loop a continuous sound at extremely low volume level in another MediaPlayer instance to force it to stay awake. That's not appealing to me. Ideas? --~--~-~--~~~---~--~~ 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: SQLite functions - how to use them?
While that works, it will create a Cursor with 'N' rows and then counts the number of rows. If you instead retrieved count(*) as a column, you'd have a Cursor with 1 row, with a field that contains the count. The latter is more efficient. On Wed, Apr 1, 2009 at 5:03 PM, Glen Humphrey glendon.humphr...@gmail.com wrote: I've used this and it works for me. c.getCount(); On Apr 1, 12:34 pm, nEx.Software justin.shapc...@gmail.com wrote: I have found that, if you will be doing a lot of data access, compiled statements will cut the time to complete most operations in half. This is particularly true of inserts. Used in conjunction with beginTransaction()/endTransaction(), using compiled statements can make your data access quite swift. In addition to being faster, I find it easier to construct compiled statements as I can just use plain SQL syntax. Of course, getting familiar with the functions themselves is an important first step. --~--~-~--~~~---~--~~ 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: screen sleeps while playing the video
Use MediaPlayer.setScreenOnWhilePlaying(), or use a VideoView instead of rolling your own. On Wed, Apr 1, 2009 at 10:33 PM, manoj manojkumar.m...@gmail.com wrote: Hi, I have written a video player app. Its working fine, but the problem is the screen is going to in sleep mode after playing some time. When I click on Menu button on the device, then only it wakes up. How can I solve this? Thanks, Manoj. --~--~-~--~~~---~--~~ 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: Some of the strange JAVA syntax - android specifics?
On Thu, Apr 2, 2009 at 10:13 AM, Odessa Silverberg silverberg.ode...@googlemail.com wrote: synchronized: I'd suggest your starting reading about Java Synchronization. 'synchronized' blocks prevent multiple threads from executing the same block of code at the same time. They are used to synchronize access to methods and instance-variables and avoid race-conditions. Careless use of 'synchronized' block, however, could cause dead-locks. In other word, similar to the lock key word in C/C++ There is no lock keyword in C/C++ --~--~-~--~~~---~--~~ 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 What Cube Face Is Facing Me
Since you're rotating and drawing the cube, shouldn't you have that information in your app already? On Thu, Apr 2, 2009 at 7:30 PM, William william.caine...@gmail.com wrote: Hi Folks, I am drawing and rotating a cube. Is there a programmatic way to tell what side of the cube is facing me? For example if I randomly spin the cube when done spinning. I want to know which face(s) I am looking at. 10% of face 1, 90% of face 2. --~--~-~--~~~---~--~~ 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 What Cube Face Is Facing Me
On Fri, Apr 3, 2009 at 7:24 AM, William william.caine...@gmail.com wrote: //i rotate the cube using the following //xRot,yRot are inc or decremented to change angles gl.glRotatef(xRot, 1.0f, 0.0f, 0.0f); gl.glRotatef(yRot, 0.0f, 1.0f, 0.0f); So yes i have access to yRot and xRot but they numbers range from -900 to +900. I figure I can used them somehow to tell what is rotated but I am unsure how. i just pass them in and it magically rotates for me. so i am unsure how to tell from the numbers what angle the cube is at. can I take a trig function to them or what? or do i take the xRot % 360 and the remainder is what degree I am at. Or is xRot in radians so I must convert it. The angles are in degrees. --~--~-~--~~~---~--~~ 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 is the proper handling of action.MEDIA_BUTTON?
On Fri, Apr 3, 2009 at 1:35 PM, Stefan skyntc...@gmail.com wrote: Does anyone know what is the proper way of subscribing for the action.MEDIA_BUTTON - (this is sent by the button on the headset and currently controls the play/pause of the built in player). It depends. What do you want to do with it? If you just want to use it in your foreground application, then you can just handle it like any other key in onKeyDown. Be sure to return 'true' in that case, otherwise the system will catch the key event and turn it in to a broadcast. If you need to use it in a background service, then your only option is to use a broadcast receiver at a higher priority. We're aware that this is less than ideal and will implement something better in the future. --~--~-~--~~~---~--~~ 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: play video error
What do you mean by windows flat form? If you want to play a file in the emulator, you will have to create an sd card image, copy the file to it, and then run the emulator with that sd card image. You cannot play a file directly off your C: drive. On Fri, Apr 3, 2009 at 10:49 PM, Nithin Varamballi nithi...@gmail.com wrote: Hi.. Can you tell me that how to run video file in android emulator. I am using windows flat form. It is possible to run video file in android emulator using windows flat form... If possible please tell me how to run... --~--~-~--~~~---~--~~ 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: Detecting Noise!
That's not going to work on Android. On Sun, Apr 5, 2009 at 5:16 PM, MyLinuxSupport mashpl...@gmail.com wrote: You should be able to fork the audio in Linux and write a c program to do the analysis, then write your results to android... The challenge you will have is getting your c program installed on the locked down phones... Since you are only doing analysis you should be able to fork the audio path and pipe it to your application. I'm also interested in this area... Food for thought below... From: http://www.commandlinefu.com/commands/view/907/unencrypted-voicechat#comment $ On PC1: nc -l -p /dev/dsp On PC2: cat /dev/dsp | nc PC1's IP On Apr 6, 4:55 am, MrSnowflake mrsnowfl...@gmail.com wrote: The only way I see this possible is by having the MediaRecorder record some sound for a very short time, have it stop and save the file, and immediately start recording again. Then analyse the previous shot sample. You have to do it this way, because you don't have direct access to the sound stream from the mic. On 5 apr, 22:34, John Doe halila...@gmail.com wrote: Hi everyone. I am trying to develop a program which detects noise level of outside.Is it loud or silent? How loud? Where should I start? Is there any example ? Any comment will be greatly appreciated... --~--~-~--~~~---~--~~ 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: MediaPlayer API
If you want to play a file in the emulator, you will have to create an sd card image, copy the file to it, and then run the emulator with that sd card image. You cannot play a file directly off your D: drive On Mon, Apr 6, 2009 at 9:36 PM, vinny.s...@gmail.com vinny.s...@gmail.com wrote: can any body tell that how to play the file which is present in MY computer For Eg : Path=D:/Vinod/Songs can any body give the way to play the audiao file from files in system . --~--~-~--~~~---~--~~ 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 completely Destroy application
You should start by taking a look at the system log to see what the actual problem is. There will probably be a helpful stack trace in there. On Tue, Apr 7, 2009 at 4:01 AM, manohar manohar...@gmail.com wrote: Hi all, I am unable to completely destory my app. My app is thread based app. Once i exit the app by calling onDestroy method, it is exiting properly. If i try to relaunch the application is says The applicatin stoped unexpectedly, try again. If i again select my app it is launching. It means in a alternative attempt its launching. as i am guessing, its not making Null for few static objects. once it shows the exception has explained above it is making all the objects null, so that i am able to reluanch. Pls can some one suggest how to overcome this issue. How to completely destory the application?? regards manu --~--~-~--~~~---~--~~ 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: Restoring the active Activity while resuming the application
On Tue, Apr 7, 2009 at 10:04 AM, Omer Saatcioglu osaatcio...@gmail.com wrote: Hello all, I have two activities running: MainActivity and ChildActivity. Whenever the user clicks in the button in MainActivity, the ChildActivity is launched. What I want to do is this: When the active activity is the ChildActivity and the user clicks the home button then relaunch the application (like opening from the beginning), I want to see the ChildActivity instead of MainActivity that is launched. However; This is happening only when the user clicks from recent activities window. (the window opened when you long press the home button) It should already be doing what you want it to do, unless you have something in your manifest that specifically makes it not do this. What does your AndroidManifest.xml look like? --~--~-~--~~~---~--~~ 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 do i do a startActivity() in BroadcastReceiver ?
On Tue, Apr 7, 2009 at 11:55 AM, Prem Thilagar prem...@gmail.com wrote: Hi all My use case is to launch one of settings app screen when I receive a certain event in idle state. For which, I added my new intent to PhoneAppBroadcastReceiver() in PhoneApp.java (looks like this receiver handles the misc intents) But when i call startActivity(), The phone seems to go into a panic What do you mean by that? ex. startActivity(new Intent(this, NetworkSetting.class)); When starting an activity from a broadcastreceiver, you need to specify the FLAG_ACTIVITY_NEW_TASK intent flag. --~--~-~--~~~---~--~~ 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/MediaPlayer(1066): setDataSource called in state 128
Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer that was already initialized, without first calling MediaPlayer.reset() On Tue, Apr 7, 2009 at 1:28 PM, ATrubka atru...@gmail.com wrote: Hi, guys. I'm using MediaPlayer and sometimes when first audio is about to end and I click to the next audio I get the exception below. Looks like the MediaPlayer is in some weird state of stopping playing and cannot accept audio at the moment. The exception goes to the native code which is greeks to me. I couldn't find anything about this error on the internet either. Is anyone here familiar with the problem? Thank you in advance! 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in state 128 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play chapter audio 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): java.lang.IllegalStateException 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at android.media.MediaPlayer.setDataSource(Native Method) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerService.playResource (AudioPlayerService.java:291) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerService.access$3 (AudioPlayerService.java:287) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter (AudioPlayerService.java:89) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact (AudioPlayerRemoteInterface.java:99) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at android.os.Binder.execTransact(Binder.java:276) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at dalvik.system.NativeStart.run(Native Method) --~--~-~--~~~---~--~~ 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 completely Destroy application
Sure, but that's just masking the real problem, and is preventing the system from caching your application. On Tue, Apr 7, 2009 at 9:48 PM, manohar manohar...@gmail.com wrote: Thanks, android.os.Process.killProcess(android.os.Process.myPid()); this got worked for me On Apr 7, 9:25 pm, Marco Nelissen marc...@android.com wrote: You should start by taking a look at the system log to see what the actual problem is. There will probably be a helpful stack trace in there. On Tue, Apr 7, 2009 at 4:01 AM,manoharmanohar...@gmail.com wrote: Hi all, I am unable to completely destory my app. My app is thread based app. Once i exit the app by calling onDestroy method, it is exiting properly. If i try to relaunch the application is says The applicatin stoped unexpectedly, try again. If i again select my app it is launching. It means in a alternative attempt its launching. as i am guessing, its not making Null for few static objects. once it shows the exception has explained above it is making all the objects null, so that i am able to reluanch. Pls can some one suggest how to overcome this issue. How to completely destory the application?? regards manu- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Playback of dynamic MIDI?
This is not possible right now. On Wed, Apr 8, 2009 at 8:26 PM, meantime dangerch...@gmail.com wrote: For one of my apps I generate MIDI data on the fly. Is there any way to play MIDI data from a java.io.InputStream or directly from a byte []? So far I've only seen ways to do MIDI playback from files. Given the continuous and dynamic nature of my audio there is no way I can write it to a file first. -c --~--~-~--~~~---~--~~ 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 I call startActivity() in BradocastReceiver
You already asked this exact same question from a different email address. Please don't start multiple threads for the same question. On Tue, Apr 7, 2009 at 11:26 AM, yeons...@gmail.com yeons...@gmail.com wrote: hello, I'd like to launch one of settings app screen when I received a certain event in idle state. For that, I added my new intent to PhoneAppBroadcastReceiver() in PhoneApp.java (because it seems this receiver handles the misc intents) But if I called startActivity(), seems phone goes to panic. ex. startActivity(new Intent(this, NetworkSetting.class)); 1. How can I launch the activity inside of bradcastreceiver? 2. If the activity which I want to start is already started, how can I check it? I read can use NEW_TASK_LAUNCH but don't know how to use it. If you have a sample code, could you post it? Thank you! --~--~-~--~~~---~--~~ 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/MediaPlayer(1066): setDataSource called in state 128
I am one, and the error you posted indicates you called setDataSource while the MediaPlayer was in the 'playback completed' state. It could be a race condition in the framework, but since I have never seen this problem occur with the Android music app, I'm inclined to think it's a problem with your code. As a workaround, you could create a new MediaPlayer when you want to play something new. On Wed, Apr 8, 2009 at 1:05 PM, ATrubka atru...@gmail.com wrote: Guys, please... Is there any Android native code developers around? On Apr 8, 12:38 am, ATrubka atru...@gmail.com wrote: MediaPlayer.reset() always gets invoked. Here's the exact lines of code: _mediaPlayer.reset(); _mediaPlayer.setDataSource(resource); _mediaPlayer.prepare(); _mediaPlayer.start(); Additionally, the error occurs only when next audio starts while previous audio is about to end. If next audio starts in the middle of the playback or after it has completely stopped playing, then everything works fine. It looks pretty much like a synchronization issue to me. This method is not synchronized at the moment. Since most of the MediaPlayer code is native I'm not sure what should be synchronized. On Apr 7, 9:20 pm, Marco Nelissen marc...@android.com wrote: Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer that was already initialized, without first calling MediaPlayer.reset() On Tue, Apr 7, 2009 at 1:28 PM, ATrubka atru...@gmail.com wrote: Hi, guys. I'm using MediaPlayer and sometimes when first audio is about to end and I click to the next audio I get the exception below. Looks like the MediaPlayer is in some weird state of stopping playing and cannot accept audio at the moment. The exception goes to the native code which is greeks to me. I couldn't find anything about this error on the internet either. Is anyone here familiar with the problem? Thank you in advance! 04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in state 128 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play chapter audio 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): java.lang.IllegalStateException 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at android.media.MediaPlayer.setDataSource(Native Method) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerService.playResource (AudioPlayerService.java:291) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerService.access$3 (AudioPlayerService.java:287) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter (AudioPlayerService.java:89) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact (AudioPlayerRemoteInterface.java:99) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at android.os.Binder.execTransact(Binder.java:276) 04-07 20:19:35.855: ERROR/AudioPlayerService(1066): at dalvik.system.NativeStart.run(Native Method) --~--~-~--~~~---~--~~ 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 get MediaRecorder to record in MP3 format
There is no mp3 encoder included in Android currently, so you can't record to mp3. On Fri, Apr 10, 2009 at 5:13 PM, admin.androidsl...@googlemail.com admin.androidsl...@googlemail.com wrote: Would be more useful than AMR / MP4. Also would be compatible with the very handy source code for RingDroid. --~--~-~--~~~---~--~~ 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: sdcard
It would help if you said what error you're getting. You can check whether the file is actually there by doing something like adb shell ls -l /sdcard and checking that the file exists. On Fri, Apr 10, 2009 at 9:23 PM, Nithin nithi...@gmail.com wrote: Hi to all I push the one video file... and tried to play that video file in emulator.. But i got error... Can any tell me how can i check weather video file insert or not... Thank You Nithin N V --~--~-~--~~~---~--~~ 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: sdcard
Are the files in a supported format? How did you put the files in /sdcard? On Fri, Apr 10, 2009 at 10:33 PM, l hx lihongxia8...@gmail.com wrote: and i meet a matter such as: some file in the /sdcard can not be seen in the trackbrowserActivity of music app. i found the file also can not be found in the database of the mediaprovider. who know why? On Sat, Apr 11, 2009 at 1:24 PM, Marco Nelissen marc...@android.com wrote: It would help if you said what error you're getting. You can check whether the file is actually there by doing something like adb shell ls -l /sdcard and checking that the file exists. On Fri, Apr 10, 2009 at 9:23 PM, Nithin nithi...@gmail.com wrote: Hi to all I push the one video file... and tried to play that video file in emulator.. But i got error... Can any tell me how can i check weather video file insert or not... Thank You Nithin N V --~--~-~--~~~---~--~~ 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: sdcard
What format and resolution is this file? If it's high res H264, then the emulator is probably too slow to play it. On Sat, Apr 11, 2009 at 12:07 AM, Nithin Varamballi nithi...@gmail.com wrote: Thanks for replying I dont have real phone... I am working in Emulator... But i got error like Cannot paly the video... Thanks Nithin n v --~--~-~--~~~---~--~~ 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: FTP on android
Are you accessing the server through wi-fi, or through the carrier network? If the latter, make sure it's actually accessible from your carrier's network. On Sat, Apr 11, 2009 at 2:39 PM, tiwana tiwana.birj...@gmail.com wrote: By th way the problem is with my dev phone not with emulator, emulator is working fine. On Apr 11, 2:07 pm, tiwana tiwana.birj...@gmail.com wrote: Actually my bucket upload is also not working.It is not able to connect to anyFTPserver. What settings do i need to change? David Given wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark Murphy wrote: [...] Bear in mind that the Android emulator runs in a virtual machine (qemu). Just because you can get to theFTPserver from your desktop does not necessarily mean you can get to it from the virtual machine. Also, don't forget that depending on how youFTPsession is configured then the server might need to make a connection back to your Android system ---FTPis a ghastly protocol, and needs to be configured just right (PASV) to avoid this: http://slacksite.com/other/ftp.html - -- ┌─── dg@cowlark.com ─http://www.cowlark.com─ │ │ All power corrupts, but we need electricity. --- Diana Wynne Jones, │ _Archer's Goon_ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org iD8DBQFJ4NTRf9E0noFvlzgRArcJAJ9PaPtNzwl35G+ziZH+wWXKjCLCfgCfWvl/ G6lErc/AmwUU36VYUb1K1Fs= =PFsP -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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: sdcard
mp4 is a container, which can contain all kinds of video formats. What codec was used to encode the video? On Sat, Apr 11, 2009 at 11:26 PM, Nithin Varamballi nithi...@gmail.com wrote: Hi Its mp4 format... Is it possible to do the videostreming Thank You Nithin N V --~--~-~--~~~---~--~~ 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: finish() not killing Activity
Are you sure you don't have several instances of activity C, and each press of the back button exits one until you finally get back to activity B? Try printing this in C.onDestroy() to make sure. On Sun, Apr 12, 2009 at 5:07 AM, Todd Sjolander guyfantas...@gmail.com wrote: Hello, I've got an application that has (among other things) three Activities, let's call them A, B, and C. A is the main navigation point for the entire application, and launches B and C directly using startActivity(). They work fine that way. However, when I call C from inside B, I get a strange problem. The code for launching Activity C is exactly the same in both places. The problem is the hardware back button. In the emulator, it takes two presses of the back button in order to close Activity C and come back to B. On a G1, it takes 3 or 4 presses. Upon seeing this, I implemented the usual suspects in C - onPause(), onStop(), and onDestroy(), and onResume() in B. When I press the back button from C and it doesn't work, I get onPause(), onStop(), onDestroy () - in that order, but nothing happens. When it works (on press 3 or 4 on the G1), I get onPause(), then onResume() in B, then onStop() and onDestroy(). I've tried catching the key press of the back button and calling finish (), but that doesn't make a difference. Has anyone seen this? To pre-empt some questions: All C does is display some data. There are no threads or any other special resources that C might have an active handle to that's preventing it from closing. But out of curiosity, if it did, how would I detect that? Any ideas for further diagnostics here? I'm out of 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: sdcard
If it's been scanned, but doesn't appear in the database (as you said earlier), you'll have to figure out why the file was rejected. Also, if you're having problems on a particular device, you should probably post over on the android-porting list instead of here. On Sun, Apr 12, 2009 at 5:47 AM, l hx lihongxia8...@gmail.com wrote: i am sure that the file can been played in android. when i inport android to my device such as pxa310, it can be played in my device. but i can not be seen in my emulation. but some other mp4 file can been seen in my emulation. i just copy the file into the sdcard normally and can be seen in the /sdcard catalog. i see in the mediacanner.java that ttis file is been sannered also. On Sat, Apr 11, 2009 at 1:58 PM, Marco Nelissen marc...@android.com wrote: Are the files in a supported format? How did you put the files in /sdcard? On Fri, Apr 10, 2009 at 10:33 PM, l hx lihongxia8...@gmail.com wrote: and i meet a matter such as: some file in the /sdcard can not be seen in the trackbrowserActivity of music app. i found the file also can not be found in the database of the mediaprovider. who know why? On Sat, Apr 11, 2009 at 1:24 PM, Marco Nelissen marc...@android.com wrote: It would help if you said what error you're getting. You can check whether the file is actually there by doing something like adb shell ls -l /sdcard and checking that the file exists. On Fri, Apr 10, 2009 at 9:23 PM, Nithin nithi...@gmail.com wrote: Hi to all I push the one video file... and tried to play that video file in emulator.. But i got error... Can any tell me how can i check weather video file insert or not... Thank You Nithin N V --~--~-~--~~~---~--~~ 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 not catched on real device using Activity.dispatchEventType
Are you sure that settings[1], settings[2] and settings[3] are true on the device? On Sun, Apr 12, 2009 at 5:20 AM, TjerkW tje...@gmail.com wrote: Hello all! I am creating a game in which the user can control a ship by - Using DPAD - Using touchscreen - Using trackball - And even using orientation events (roll pitch etc) It all works on the emulator but when i open the game on a real device then the events (touch, trackball) do not work anymore. I am catching evetns by overriding the dispatchEventType() methods. This is the code in my Activity class that catches the events: public boolean dispatchKeyEvent(KeyEvent e) { super.dispatchKeyEvent(e); return controller.onKeyEvent(e.getKeyCode(), e); } public boolean dispatchTrackballEvent(MotionEvent e) { if(settings[2] || settings[3]) { return controller.onTrackballEvent(e); } else { return super.dispatchTrackballEvent(e); } } public boolean dispatchTouchEvent(MotionEvent e) { if(settings[1]) { return controller.onTouchEvent(e); } else { return super.dispatchTouchEvent(e); } } I think the dispatchKeyEvent(..) method works fine, but the other ones do not work on a real device. They work without problems on the emulator. What am i doing wrong? I really do not understand it. Thanks in advance. - Tjerk Wolterink --~--~-~--~~~---~--~~ 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 is the recording format of Intent .RECORD_SOUND_ACTION?
They don't really decode let alone encode those formats though, hence the 'cheap' moniker. Short of porting a full mp3 encoder to android, there is no way to convert sound to mp3 format on the phone. On Sun, Apr 12, 2009 at 11:40 AM, bw ben.weisb...@gmail.com wrote: Try looking at the source code for RingDroid: http://code.google.com/p/ringdroid/source/checkout Particularly the CheapAMR and CheapMP3 classes which can read/write these formats: http://code.google.com/p/ringdroid/source/browse/#svn/trunk/src/com/ringdroid/soundfile On Mar 13, 5:27 am, zeeshan genx...@gmail.com wrote: any solution plz? On Mar 5, 9:20 am, zeeshan genx...@gmail.com wrote: thanks for the reply Dave, i was really waiting for it. is there any way to transcode it in mp3 after record finish. i need this kind of output: Intent intent = new Intent (MediaStore.Audio.Media.RECORD_SOUND_ACTION); startActivityForResult(intent, ACTIVITY_RECORD_SOUND); protected void onActivityResult(int requestCode, int resultCode,Intent data) { if(requestCode == SELECT_AUDIO){ if (resultCode == RESULT_CANCELED) { } else { if (data != null) { Uri RecordedAudio = data.getData(); convertInMp3(Uri); } } } } ? On Mar 5, 7:59 am, Dave Sparks davidspa...@android.com wrote: The only audio format supported on G1 is AMR format (raw .AMR file). On Mar 4, 1:18 pm, zeeshan genx...@gmail.com wrote: Hi, can anyone tell me what is the default format of android recording. i have recorded an audio clip but dont know how can i check its extention? i am using this activity Intent intent = new Intent (MediaStore.Audio.Media.RECORD_SOUND_ACTION); startActivityForResult(intent, ACTIVITY_RECORD_SOUND); i need mp3/wav format, is it the same or do i need to convert it? how? please reply me thanks.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: getContentResolver.query(Images.Media.EXTERNAL_CONTENT_URI ...) returns null on device
Is there an sd card in the phone? On Sun, Apr 12, 2009 at 5:24 PM, yves...@gmail.com yves...@gmail.com wrote: This code works fine with the emulator, I can get a cursor to all the images, but after I installed the app into the real device (G1), I ran the app, this call returns null. If I change from EXTERNAL_CONTENT_URI to INTERNAL_CONTENT_URI, at least it returns not null cursor and the count is 0. Anything I should do to get this to work? --~--~-~--~~~---~--~~ 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: finish() not killing Activity
On Sun, Apr 12, 2009 at 6:28 PM, Todd Sjolander guyfantas...@gmail.com wrote: Marco, your hunch was right. I was somehow creating multiple copies of Activity C. In case anyone can benefit from this, let me explain how it went wrong. I implemented onTouch() in Activity B, which would create an Intent for Activity C, and then call startActivity(). For some reason, onTouch() would get called multiple times with each touch, launching a new Activity C each time. Yes, the onTouchEvent() method will usually be called multiple times on an actual device, since you can't hold your finger completely still, and so you will get a continuous stream of 'move' events following the 'down' event. You should only get one 'down' event though, so you could always check whether the event was a down event, and only start activity C when it is. --~--~-~--~~~---~--~~ 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: Loading New Data with Back Button
If 'view 2' is another activity, then the onResume() of 'view1' will be called after pressing the back button, so you could simply redisplay your data there. On Fri, Apr 10, 2009 at 7:16 PM, apple.developer27 apple.develope...@yahoo.com wrote: I have a message application so that on view 1 is displayed a list of messages and when you go to view 2 (subactivity) you can send a message. I want the program to work so that when you hit the android back button, you can go back to view 1 and see the list of messages including the new message. Right now only the old data is displayed, and I noticed that displayContent() is not called when going back which I assumed it would. Is there any way to specify that when the back button is hit, to call displayContent() again on the previous activity? --~--~-~--~~~---~--~~ 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: onCreateContextMenu
The return type should be void, not boolean. See: http://developer.android.com/reference/android/app/Activity.html On Sat, Apr 11, 2009 at 8:06 AM, streetdestroy...@gmail.com streetdestroy...@gmail.com wrote: public boolean onCreateContextMenu(Menu menu, View v,ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.add(0,DELETE_ID, 0, R.string.menu_delete); } hi i did the notepadv2-tutorial and at this method eclipse shows me an error: that this method in the type Activity is not applicable for the arguments(menu, v, menuinfo). what's here the problem? --~--~-~--~~~---~--~~ 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: not able to play file when set data source to the sdcard file
On Mon, Apr 13, 2009 at 2:52 AM, Honest honestsucc...@gmail.com wrote: Hello, I am trying to play file which is stored in SDCARD in emulator. I have Linux O/S. So i need to provide command in run configuration. I am providing following parameter. -sdcard /usr/android/sdcard/mysdcard.iso -audio oss The sd card image needs to be a FAT filesystem image, not an ISO image. --~--~-~--~~~---~--~~ 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: sdcard
That message indicates the name is not valid utf-8. What's the name/encoding you used? On Mon, Apr 13, 2009 at 5:39 AM, l hx lihongxia8...@gmail.com wrote: i found the matter may be the title of the file. because i seen the log LOGW(JNI WARNING: illegal start byte 0x%x\n, utf8);.who know why? On Sun, Apr 12, 2009 at 11:46 PM, Marco Nelissen marc...@android.com wrote: If it's been scanned, but doesn't appear in the database (as you said earlier), you'll have to figure out why the file was rejected. Also, if you're having problems on a particular device, you should probably post over on the android-porting list instead of here. On Sun, Apr 12, 2009 at 5:47 AM, l hx lihongxia8...@gmail.com wrote: i am sure that the file can been played in android. when i inport android to my device such as pxa310, it can be played in my device. but i can not be seen in my emulation. but some other mp4 file can been seen in my emulation. i just copy the file into the sdcard normally and can be seen in the /sdcard catalog. i see in the mediacanner.java that ttis file is been sannered also. On Sat, Apr 11, 2009 at 1:58 PM, Marco Nelissen marc...@android.com wrote: Are the files in a supported format? How did you put the files in /sdcard? On Fri, Apr 10, 2009 at 10:33 PM, l hx lihongxia8...@gmail.com wrote: and i meet a matter such as: some file in the /sdcard can not be seen in the trackbrowserActivity of music app. i found the file also can not be found in the database of the mediaprovider. who know why? On Sat, Apr 11, 2009 at 1:24 PM, Marco Nelissen marc...@android.com wrote: It would help if you said what error you're getting. You can check whether the file is actually there by doing something like adb shell ls -l /sdcard and checking that the file exists. On Fri, Apr 10, 2009 at 9:23 PM, Nithin nithi...@gmail.com wrote: Hi to all I push the one video file... and tried to play that video file in emulator.. But i got error... Can any tell me how can i check weather video file insert or not... Thank You Nithin N V --~--~-~--~~~---~--~~ 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: Does iTunes/3GPP metadata supported?
Some of the iTunes metadata is supported, but not all of it. If you bought a song from the iTunes music store, it should at least get artist/album/title/year from the file. On Mon, Apr 13, 2009 at 1:41 AM, Ethan lawrence@gmail.com wrote: Hi All, Please kindly help to answer the questions below, thank you very very much! 1. Does AAC codec supported in .mp4 container with iTunes metadata? 2. Does AAC codec supported in .3gp container with 3GPP metadata? Also please kindly indicate how retrieve these information, tracing the codes? Thanks a lot!! Ethan --~--~-~--~~~---~--~~ 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: help......i am a Beginners
You almost no information as to what goes wrong, but my guess is that since you didn't input any values, the call to Double.parseDouble() throws an exception. BTW, since you say you're a beginner, you might want to give the android-beginners mailing list a try. On Mon, Apr 13, 2009 at 7:11 AM, yoyo zjw...@gmail.com wrote: package com.androidyo.firstbmi; import java.text.DecimalFormat; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class Bmi extends Activity { /** Called when the activity is first created. */ �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button=(Button)findViewById(R.id.submit); button.setOnClickListener(calcBMI); } private OnClickListener calcBMI = new OnClickListener() { public void onClick(View v) { DecimalFormat nf=new DecimalFormat(0.00); EditText fieldheight=(EditText)findViewById(R.id.height); EditText fieldweight = (EditText)findViewById(R.id.weight); double height = Double.parseDouble(fieldheight.getText().toString ()); height=height/100; double weight = Double.parseDouble(fieldweight.getText().toString ()); TextView result = (TextView)findViewById(R.id.result); TextView fieldsuggest = (TextView)findViewById(R.id.suggest); if(height=0||weight=0) result.setText(input wrong); else { double BMI = weight / (height * height); result.setText(Your BMI is +nf.format(BMI)); if(BMI25){ fieldsuggest.setText(R.string.advice_heavy); }else if(BMI20){ fieldsuggest.setText(R.string.advice_light); }else{ fieldsuggest.setText(R.string.advice_average); } } } }; } MY question: when runing the app .if i input nothing .it will force close how can i fix it??? please give me a hang...i am a beginners.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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Gallery Child View Problem
How did you get rid of the onFling event? It sounds like whatever you did to achieve that also broke scrolling. On Mon, Apr 13, 2009 at 8:22 AM, Alekh alek...@gmail.com wrote: I have created a child class from the Gallery view, named MyGallery. I did this because I wanted to get rid of the onFling event in the gallery view. Having that achieved, it lead me to a different problem. Scrolling the Gallery with the Dpad doesn't work now. When I tried using the original Gallery class, the dpad works fine. But when I extend the Gallery and use my custom gallery class, the dpad stops working. Am I missing something? Please help. --~--~-~--~~~---~--~~ 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: Apps labeled as Tetris Clones removed from Android Market
On Mon, Apr 13, 2009 at 10:39 AM, Ikon ayanafr...@gmail.com wrote: This is not legal advice. I actually am a lawyer, and these copyright violation claims are very shaky. Basically, they have a copyright to the exactly worded source code. So if they wrote int numTetrads = 50 and you wrote int numBlocks = 50 you would not be infringing. You seem to be saying that I could take someone's source code, rename all the variables, and then claim it as my own. That can't be right. Also note that with most languages the binary would be exactly the same. --~--~-~--~~~---~--~~ 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: Apps labeled as Tetris Clones removed from Android Market
You can never patent abstract ideas. Game ideas cannot be patented OK, so we've established you're not a patent lawyer... :) My favorite patent is the one for swinging sideways on a swing, which IMO illustrates you can patent pretty much anything. On Mon, Apr 13, 2009 at 10:44 AM, Ikon ayanafr...@gmail.com wrote: Your contention that grown up operating systems should not allow you to copy ideas is totally unfounded. You can never patent abstracty ideas. Game ideas cannot be patented. Whether they should be is a different discussion. You can go right and now, and make a game on Windows with a story very similar to fallout, and write all your own code, and use all your own graphics/sound assets and you will not be infringing on that IP in any way. A company may come and try to sue you, but that has no relevance to a maturity of an operating system. On Apr 13, 10:43 am, Sundog sunns...@gmail.com wrote: Anyone who is surprised by this must be very, very new to the programming game. I've been waiting for this since the store opened. IMHO, to the extent that the Android community becomes a proxy for those that think All Ideas Should Be Free And Stealable, that is the extent to which Android will never be a real grown-up operating system. On Apr 7, 8:43 am, tasos.klei...@gmail.com tasos.klei...@gmail.com wrote: On Saturday April 4th, I received a message from google saying that my game Robotic Space Rock was pulled from the android market after a request made by a legal firm representing an entity known as Tetris Company. My application was removed from the android market together with Blocks, Cubik, Net Tetris, Netblocks and Tetroid (6 apps in total) under claim that it violates the DMCA and more specifically trademarks and copyrighted material owned by the Tetris Company. However, none of the trademarks or copyrighted material (music, graphics and sound effects) are present in my game. Sound effects and music were created by me specifically for the game. There is no reference to the word tetris in the game. Additionally, all the game code, graphics and sound effects were created by me and published on the code sitehttp://code.google.com/p/monolithandroid Additionally, I am not aware of a software patent covering the game mechanics of Tetris, so I cannot see how I could violate something that is not protected by a software patent. Also, even if the game was protected by a patent, the patent would have expired, since the original game, Tetris, was created 23 years ago. However game mechanics cannot be covered by patents. I would also like to point out that my game is available completely free of charge to every user of the android market. I wrote those concerns to Google and I sent an email to the EFF. The bottom line is that for my application to be restored on the android market, I have to send a DMCA counter-notification. And then the Tetris Company can sue and take the case to Court. When games were pulled from the iPhone App store, they blamed apple, but it is not hard to see that behind application removals we can find companies like the Tetris Company, that demand application removals claiming copyright infringement and trademarks. However, it is not easy to battle these companies as individual developers. I, for example, am a Greek citizen living in Greece, so it is difficult for me to file a counter-notification, because then the Tetris company will probably sue me and I will have to defend my case in court. Why should I bother? Am I making money out of the game? No! But even if I did you can see how easy it is for corporations to neutralize developers like that. I think that something should be done. Independent developers should get together to battle against such misuse of the law by corporations. And to those that want more facts, you can find more details on my blog:http://tkcodesharing.blogspot.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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Apps labeled as Tetris Clones removed from Android Market
On Mon, Apr 13, 2009 at 11:40 AM, Ikon ayanafr...@gmail.com wrote: The variable example was just a small example. My point was that on the variable rename alone is not a copyright violation, just because it relates to the same idea. However you cannot copy someones functions and rename the functions/vars and make it your own. This is obviously a close call, and it must be made by a fact-finder. As for your example of a swing, my comment was directed towards video- games, and not physical apparatuses, which are clearly patentable. I know what is accepted as patentable or not by the USPTO, as I submit these patents on a regular basis. If you file patents on a regular basis, then surely you must have heard of the 'swing' patent before, which isn't actually a patent for the apparatus itself, but for a method for swinging sideways on a standard swing. Anyone who was ever a child should be aware of the prior art for that, yet it still got issued. Perhaps patent clerks don't go through the normal human growth cycle but emerge fully grown from a vat or something... :) --~--~-~--~~~---~--~~ 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: One line causing lots of garbage collection. String.format with float. Help?
Don't use String.format(). It creates all kinds of temporary objects every time you call it. Instead, create a single StringBuilder and Formatter, and then reuse those every time you need to format a string. On Mon, Apr 13, 2009 at 7:37 PM, DavidG dgu...@gmail.com wrote: In my ListView, there's one line of code in my ViewBinder that causes lots of garbage collection as I scroll through the list, about every two seconds... D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms The offending code is here, which formats a price for each item in the list: String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); price = new StringBuffer($).append(String.format(%. 2f,pricef)).toString(); ((TextView)view).setText(price); If I comment out the line with String.format, the garbage collection goes away. So what's the right way to do this to avoid allocations? That database field holds an unformatted text string which I'm trying to format into proper currency format (example: format 1.5 to $1.50) Any pointers on how to improve 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] Re: using touch screen to draw a straight line
On Mon, Apr 13, 2009 at 5:12 PM, gandor gand...@gmail.com wrote: Hi Folks, Want to draw a line when I touch screen at two points. I can see OnTouch been invoked but after than everything breaks looks, the application crashes I am using drawLine in Canvas. Please let me know what I am doing wrong Look at the system log , it probably tells you exactly what you're doing wrong. --~--~-~--~~~---~--~~ 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: One line causing lots of garbage collection. String.format with float. Help?
When you say that it hasn't improved your garbage collection problem, do you mean that it still GCs 13000 objects every 2 seconds? On Mon, Apr 13, 2009 at 10:42 PM, DavidG dgu...@gmail.com wrote: Thanks for the feedback.. Now I'm trying to use StringBuilder and Formatter, but I just can't get it to stop doing the garbage collection. I'm not sure how to go about reusing the Formatter. At first, I just tried creating a public static Formatter member variable and using it directly: public Formatter mFormatter = new Formatter(); (then later within setViewValue()... ) mFormatter.format(%.2f,pricef).toString(); Unfortunately the formatter seemed to keep building onto itself, making each item in the list return a longer and longer string as I scrolled. Then I looked into the Android source code and found an example that I tried to mimick. While it gives me the output I expect, it hasn't improved my garbage collection problem. I'm just going to post the majority of my ViewBinder class, can someone point out where I'm going wrong? START CODE import java.util.Formatter; import android.database.Cursor; import android.graphics.Color; import android.graphics.Paint; import android.view.View; import android.widget.ImageView; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public class ItemBinder implements SimpleCursorAdapter.ViewBinder { public static final StringBuilder mBuilder = new StringBuilder(); public static final Formatter mFormatter = new Formatter(mBuilder); public static final Object[] mArgs = new Object[1]; public boolean setViewValue(View view, Cursor cursor, int columnIndex) { switch(view.getId()) { case R.id.price: // Format the price nicely String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); Object[] args = mArgs; args[0] = pricef; mBuilder.setLength(0); price = mFormatter.format(%.2f, args).toString(); ((TextView)view).setText(price); return true; } return false; } } END CODE On Apr 13, 10:40 pm, Marco Nelissen marc...@android.com wrote: Don't use String.format(). It creates all kinds of temporary objects every time you call it. Instead, create a single StringBuilder and Formatter, and then reuse those every time you need to format a string. On Mon, Apr 13, 2009 at 7:37 PM, DavidG dgu...@gmail.com wrote: In my ListView, there's one line of code in my ViewBinder that causes lots of garbage collection as I scroll through the list, about every two seconds... D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms The offending code is here, which formats a price for each item in the list: String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); price = new StringBuffer($).append(String.format(%. 2f,pricef)).toString(); ((TextView)view).setText(price); If I comment out the line with String.format, the garbage collection goes away. So what's the right way to do this to avoid allocations? That database field holds an unformatted text string which I'm trying to format into proper currency format (example: format 1.5 to $1.50) Any pointers on how to improve 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] Re: How to use headset button to pick up/hang up a call?
The headset button already answers an incoming call, but once you're in the call, it mutes/unmutes. If you want it to hang up the call instead, you'll need to modify the Phone application. On Tue, Apr 14, 2009 at 2:44 AM, sein fang.sh...@zte.com.cn wrote: When I'm testing the functionality of the headset button in a call,it just muted the mic,didn't hang up the call.And if there is no call,when I press the button,there will be a song playing,so I think the keycode is correctly reported.there maybe some code I need to add? Anybody knows how to? --~--~-~--~~~---~--~~ 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: Re-installation failed due to different application signatures
You can't replace or uninstall the sytem apps, so if you want to create a music player based on the Android one, you'll have to put in in a different package. On Tue, Apr 14, 2009 at 3:07 AM, dycl3 dy...@126.com wrote: hello: out put by eclipse: [2009-04-14 17:55:39 - MusicBrowserActivity] Uploading MusicBrowserActivity.apk onto device 'emulator-5554' [2009-04-14 17:55:48 - MusicBrowserActivity] Installing MusicBrowserActivity.apk... [2009-04-14 17:56:11 - MusicBrowserActivity] Application already exists. Attempting to re-install instead... [2009-04-14 17:56:23 - MusicBrowserActivity] Re-installation failed due to different application signatures. [2009-04-14 17:56:23 - MusicBrowserActivity] You must perform a full uninstall of the application. WARNING: This will remove the application data! [2009-04-14 17:56:23 - MusicBrowserActivity] Please execute 'adb uninstall com.android.music' in a shell. [2009-04-14 17:56:23 - MusicBrowserActivity] Launch canceled! adb uninstall com.android.music say Failure. who know what should i do. --~--~-~--~~~---~--~~ 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: One line causing lots of garbage collection. String.format with float. Help?
I don't know then. I don't think that Formatter.format() should create that many temporary objects. Have you tried formatting the number differently, like as an integer? (note also that if this is a sqlite based cursor, I think you can just getFloat() the column, so you don't have to parse a string in to a float) On Tue, Apr 14, 2009 at 2:29 PM, DavidG dgu...@gmail.com wrote: That's right, with the code above, it still GCs about 13000 every 2 seconds (as long as I'm scrolling the list quickly back and forth). If I comment out the formatter line (price = mFormatter.format(%.2f, args).toString();) it doesn't do the GCs anymore, but I of course lose my formatting. On Apr 14, 10:28 am, Marco Nelissen marc...@android.com wrote: When you say that it hasn't improved yourgarbagecollection problem, do you mean that it still GCs 13000 objects every 2 seconds? On Mon, Apr 13, 2009 at 10:42 PM, DavidG dgu...@gmail.com wrote: Thanks for the feedback.. Now I'm trying to use StringBuilder and Formatter, but I just can't get it to stop doing thegarbage collection. I'm not sure how to go about reusing the Formatter. At first, I just tried creating a public static Formatter member variable and using it directly: public Formatter mFormatter = new Formatter(); (then later within setViewValue()... ) mFormatter.format(%.2f,pricef).toString(); Unfortunately the formatter seemed to keep building onto itself, making each item in the list return a longer and longer string as I scrolled. Then I looked into the Android source code and found an example that I tried to mimick. While it gives me the output I expect, it hasn't improved mygarbagecollection problem. I'm just going to post the majority of my ViewBinder class, can someone point out where I'm going wrong? START CODE import java.util.Formatter; import android.database.Cursor; import android.graphics.Color; import android.graphics.Paint; import android.view.View; import android.widget.ImageView; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public class ItemBinder implements SimpleCursorAdapter.ViewBinder { public static final StringBuilder mBuilder = new StringBuilder(); public static final Formatter mFormatter = new Formatter(mBuilder); public static final Object[] mArgs = new Object[1]; public boolean setViewValue(View view, Cursor cursor, int columnIndex) { switch(view.getId()) { case R.id.price: // Format the price nicely String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); Object[] args = mArgs; args[0] = pricef; mBuilder.setLength(0); price = mFormatter.format(%.2f, args).toString(); ((TextView)view).setText(price); return true; } return false; } } END CODE On Apr 13, 10:40 pm, Marco Nelissen marc...@android.com wrote: Don't use String.format(). It creates all kinds of temporary objects every time you call it. Instead, create a single StringBuilder and Formatter, and then reuse those every time you need to format a string. On Mon, Apr 13, 2009 at 7:37 PM, DavidG dgu...@gmail.com wrote: In my ListView, there'sonelineof code in my ViewBinder that causes lots ofgarbagecollection as I scroll through the list, about every two seconds... D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms The offending code is here, which formats a price for each item in the list: String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); price = new StringBuffer($).append(String.format(%. 2f,pricef)).toString(); ((TextView)view).setText(price); If I comment out thelinewith String.format, thegarbagecollection goes away. So what's the right way to do this to avoid allocations? That database field holds an unformatted text string which I'm trying to format into proper currency format (example: format 1.5 to $1.50) Any pointers on how to improve
[android-developers] Re: Re-installation failed due to different application signatures
The system partition is mounted read-only for security/robustness. 2009/4/14 dycl3 dy...@126.com: hello: Thank you attention, in fact, now the question is solve , adb remount adb shell rm system/app/Music.apk then run the project with eclipse , it works good. but i don't know why i must adt remount firs, otheriwse i couldn't delete system/app/Music.apk, it's say it read only. thanks. On 4月15日, 上午2时36分, Marco Nelissen marc...@android.com wrote: You can't replace or uninstall the sytem apps, so if you want to create a music player based on the Android one, you'll have to put in in a different package. On Tue, Apr 14, 2009 at 3:07 AM,dycl3dy...@126.com wrote: hello: out put by eclipse: [2009-04-14 17:55:39 - MusicBrowserActivity] Uploading MusicBrowserActivity.apk onto device 'emulator-5554' [2009-04-14 17:55:48 - MusicBrowserActivity] Installing MusicBrowserActivity.apk... [2009-04-14 17:56:11 - MusicBrowserActivity] Application already exists. Attempting to re-install instead... [2009-04-14 17:56:23 - MusicBrowserActivity] Re-installation failed due to different application signatures. [2009-04-14 17:56:23 - MusicBrowserActivity] You must perform a full uninstall of the application. WARNING: This will remove the application data! [2009-04-14 17:56:23 - MusicBrowserActivity] Please execute 'adb uninstall com.android.music' in a shell. [2009-04-14 17:56:23 - MusicBrowserActivity] Launch canceled! adb uninstall com.android.music say Failure. who know what should i do. --~--~-~--~~~---~--~~ 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: multiple successive queries to a database
What's the error message in the system log? On Tue, Apr 14, 2009 at 10:38 PM, iki qui.af...@gmail.com wrote: The application has stopped unexpectedly. Please try again. One query always works. Two consecutive queries works about 75% of the time. Three consecutive queries works about a third. Four consecutive queries works about 10% Five doesn't seem to work at all (it worked once out of many tries). On Apr 13, 12:15 am, Ralf ralfo...@gmail.com wrote: What kind of crash do you get? Is this a force close or an exception? R/ On Thu, Apr 9, 2009 at 9:26 PM, iki qui.af...@gmail.com wrote: Has anyone other than me needed to make consecutivequeriesto a sqlitedatabase? My application works sometimes but other times (about 98% of the time), the app will crash. What I'm doing is using the sqlitedatabase.query(..) to return a cursor which I parse, I makemultiplesuccessivequeriesto the database and parse different recordsets/cursors. My question would be does a sqlitedatabase need to recover or clean up after a .query is issued? --~--~-~--~~~---~--~~ 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: sendBroadcast() is crashing
What does it say in the system log? On Wed, Apr 15, 2009 at 11:11 AM, Yogi yogesh.agrawal2...@gmail.com wrote: Hi All, I am try to post message with the help of sendBroadcast() API. But its carshing. Please find the piece of code as below: public static final String UICbkdAction = new String (android.intent.action.UICbk); protected IntentFilter CallbackFilter = new IntentFilter(UICbkdAction); CallbackReceiver=new IntentReceiver(); registerReceiver(CallbackReceiver, CallbackFilter); Intent scan = new Intent(UICbkdAction); Bundle b=new Bundle(); b.putInt(CbkType, ServerAdded); b.putString(resp, text); //b.putBoolean(result, ret_val); scan.putExtras(b); sendBroadcast(scan); -crashing with NULL pointer exception class MyIntentReceiver extends BroadcastReceiver { �...@override public void onReceive(Context context, Intent intent) { //doing something } } Please help me.. Thanks in advance, Yogi --~--~-~--~~~---~--~~ 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 dump the content of sqlite via adb shell command
On Thu, Apr 16, 2009 at 6:08 PM, Meryl Silverburgh silverburgh.me...@gmail.com wrote: Hi, I am trying to dump the content of sqlite via adb shell command. Here is what i did: $ adb shell * daemon not running. starting it now * * daemon started successfully * # sqlite3 SQLite version 3.5.9 qlite .databases seq name file --- --- -- 0main 1temp /sqlite_stmt_journals/etilqs_S9bmllRuggSwGfp sqlite .schema main sqlite .tables My questions I try both 'tables' command and dump the schema for 'main', I can't find my table. Can you please tell me what am I doing wrong? You didn't specify a database file when you launched the 'sqlite3' command. --~--~-~--~~~---~--~~ 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: reuse IDs?
yes On Fri, Apr 17, 2009 at 7:22 AM, Derek xianguan...@gmail.com wrote: Because there is no hierarchy in R.id, I presume an ID can be used in many layout.xml files. Am I correct? --~--~-~--~~~---~--~~ 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: Dropping SQLite database
It looks like you are confusing records, tables and databases. Can you post some more code, like how you create the database, how you create the table in the database, and how you store and retrieve records in the table? On Fri, Apr 17, 2009 at 5:27 AM, Zhubham sahilz...@gmail.com wrote: Hi, In my application i take some input from the user and store it in sqlite database. Now, if on second visit to save records menu, I give the previous file name then the database holding above file should be dropped and a new database should be made. I do this by : public void deleteRecord() { try { db.execSQL(DROP TABLE IF EXISTS +DATABASE_TABLE); db.execSQL(VACUUM); } catch(SQLException sqle) { sqle.printStackTrace(); } } However, on doing this the previous records are not getting deleted. With this the new records get appended to the previous ones. Can anyone please help me with this?? Thanks in advance. Best Regards, Zhubham --~--~-~--~~~---~--~~ 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: Check if a View contains another View
View.findViewById() ? On Sat, Apr 18, 2009 at 2:52 PM, xspotlivin dmbrown2...@gmail.com wrote: Is there a way to check if a view contains another certain view? I have an AbsoluteLayout view that I add multiple views to (buttons). I have a certain button, let's call it reportButton, and I want to check to see if its already within my AbsoluteLayout view. Is there like an AbsoluteLayout.contains(reportButton) method or something of the kind? This is what I want to do. myLayout is the absolutelayout and reportAll is the button. class reportAllButtonThread implements Runnable { //@Override public void run() { while(true) { if (myLayout.contains(reportAll)) { //Do something } } } } Suggestions? 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problems deleting an audio file using a media content uri
This is a problem with the media provider: it will delete the entry from the database, but won't delete the underlying file. For now, you'll have to do that yourself. On Sat, Apr 18, 2009 at 11:01 AM, estivenrpo estiven...@gmail.com wrote: Hi guys I have a Uri like content://media/external/audio/media/149 that is a audio file and i want to delete it i have tried: Uri fileUri = Uri.parse(content://media/external/audio/media/149); c.getContentResolver().delete(fileUri, null, null); I have also tried: File fileToDelete = new File(new URI(content://media/external/audio/ media/149)); fileToDelete.delete(); The file was created using the Sound recorder Intent. Actually, if I create a MediaPlayer mp, I can set the source: mp.setDataSource(QueryResults.this, Uri.parse(fileUri)); and then: mp.prepare(); mp.start(); and the file is CORRECTLY played. So if i want to delete the file i can't, why?, permision problems maybe, because my app doesn't create the file..?? Thanks in advance. --~--~-~--~~~---~--~~ 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: Problems deleting an audio file using a media content uri
Query the Uri for the MediaStore.Audio.Media.DATA column. It contains the path to the file. On Sun, Apr 19, 2009 at 1:59 PM, estivenrpo estiven...@gmail.com wrote: mm, ok, thanks but, how do i delete a uri media file manually? I only have the uri string: content://media/external/audio/media/ 149 and i don't know how to create a file object with that. I have tried: File fileToDelete = new File(new URI(content://media/external/audio/ media/149)); fileToDelete.delete(); but it doesn't work. Thanks in advance, On 19 abr, 10:19, Marco Nelissen marc...@android.com wrote: This is a problem with the media provider: it will delete the entry from the database, but won't delete the underlying file. For now, you'll have to do that yourself. On Sat, Apr 18, 2009 at 11:01 AM, estivenrpo estiven...@gmail.com wrote: Hi guys I have a Uri like content://media/external/audio/media/149 that is a audio file and i want to delete it i have tried: Uri fileUri = Uri.parse(content://media/external/audio/media/149); c.getContentResolver().delete(fileUri, null, null); I have also tried: File fileToDelete = new File(new URI(content://media/external/audio/ media/149)); fileToDelete.delete(); The file was created using the Sound recorder Intent. Actually, if I create a MediaPlayer mp, I can set the source: mp.setDataSource(QueryResults.this, Uri.parse(fileUri)); and then: mp.prepare(); mp.start(); and the file is CORRECTLY played. So if i want to delete the file i can't, why?, permision problems maybe, because my app doesn't create the file..?? Thanks in advance. --~--~-~--~~~---~--~~ 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 can i import com.android.internal.phone?
You shouldn't be sending AT commands, as they would very likely interfere with AT commands sent by the system itself, possibly leaving the radio in an inconsistent state. Also, this list is about developing using the SDK, which by definition excludes all the internal APIs. On Mon, Apr 20, 2009 at 8:42 AM, Daliang Luo luodali...@gmail.com wrote: But Romain, what should I do if I am trying to call the function invokeOemRilRequestStrings()? I am trying to send AT commands via this interface. 2009/4/20 Daliang Luo luodali...@gmail.com Thanks Romain, then may be i can use telephonymanager to talk with the interfaces? 2009/4/20 Romain Guy romain...@google.com Don't. The package name says internal because it's a private API. Do NOT use it. On Mon, Apr 20, 2009 at 1:55 AM, Nio luodali...@gmail.com wrote: Hi there, I'm trying to invoke the functions belong to class phone and PhoneFactory. But when I'm trying to import these packages, it reminds errors: code: import com.android.internal.telephony.Phone import com.android.internal.telephony.PhoneFactory ... PhoneFactory.makeDefaultPhones(this) Phone phone = PhoneFactory.getDefaultPhone() error: The com.android.internal.telephony.Phone can not be resolved. The com.android.internal.telephony.PhoneFactory can not be resolved. But some other packages can be imported. I don't know why. I think all this packages should be included in the SDK. Can any one tell me where I am getting wrong? Thanks. Nio -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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: ReStarting An Activity From A Service
On Mon, Apr 20, 2009 at 12:15 PM, Mohamed Amir mohamed.a...@gmail.comwrote: OK Mark. I am trying to make an application that show the caller-ID when there is an incoming call. And where there is another call, I wanna update the caller-ID shown. I have tried OnNewIntent but this callback wasn't called. It's onNewIntent() with a lowercase 'o'. --~--~-~--~~~---~--~~ 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: Grayscaling
You can do this more efficiently by using a Paint and a ColorFilter. On Mon, Apr 20, 2009 at 3:59 PM, sm12 mata...@gmail.com wrote: Solved. The problem was in the parameters of Color.rgb. --~--~-~--~~~---~--~~ 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: Doesn't Android-1.0 support Recording Video well?
1.0 doesn't support video recording at all. On Tue, Apr 21, 2009 at 2:56 AM, david 1 david...@gmail.com wrote: hi all, I just experienced the video recording on G1 based on the system.img of android1.0. The process just lasts about 3 seconds, then blocks. And the generated file is empty. What's the matter? Doesn't this version support video recording, yet? david --~--~-~--~~~---~--~~ 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: Encrypting application data file that is bundled with apk !
On Tue, Apr 21, 2009 at 12:04 PM, Slater easwar.satras...@gmail.com wrote: Hi, I plan to bundle an xml data file that has all the metadata required by the application. When my app loads for the first time, the xml data file is read and local database is created and populated. This xml file is a crucial part of my app and it holds at least 100k entries. I don't want this data to be compromised. Is there a way to encrypt this data file so that the file is unreadable in case someone opens the .apk file and extracts the data file. Since the decryption algorithm and key would have to be part of your apk as well, someone could conceivably decompile your app and get all the information they need to decrypt the data. So you can't make it 100% secure, you can only make it less convenient for someone trying to get the data. --~--~-~--~~~---~--~~ 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: Elan sues Apple for multitouch patent infringment... and guess what....
On Tue, Apr 21, 2009 at 12:19 PM, Stoyan Damov stoyan.da...@gmail.comwrote: On Wed, Apr 15, 2009 at 5:11 PM, Jean-Baptiste Queru j...@android.com wrote: Second, more importantly, many people who read and participate in this group and other official Android discussion groups work for companies where company policy is to avoid reading or learning about any patent-related subject, and to avoid forums and sites where such discussions routinely happen. It'd be unfortunate if those people were forced to stay away from the official groups because of patterns of patent-related discussions. Let's try to be self-moderating in that area before lawyers need to get involved (as even the most friendly lawyers can't make their involvement pleasant in that case). I call BULLSHIT. No one is forcing these guys to use their business e-mails for reading these groups. It doesn't matter what email address is used. It's the person behind the email address that matters. --~--~-~--~~~---~--~~ 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: Elan sues Apple for multitouch patent infringment... and guess what....
On Tue, Apr 21, 2009 at 12:43 PM, Stoyan Damov stoyan.da...@gmail.comwrote: On Tue, Apr 21, 2009 at 10:27 PM, Marco Nelissen marc...@android.com wrote: On Tue, Apr 21, 2009 at 12:19 PM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Apr 15, 2009 at 5:11 PM, Jean-Baptiste Queru j...@android.com wrote: Second, more importantly, many people who read and participate in this group and other official Android discussion groups work for companies where company policy is to avoid reading or learning about any patent-related subject, and to avoid forums and sites where such discussions routinely happen. It'd be unfortunate if those people were forced to stay away from the official groups because of patterns of patent-related discussions. Let's try to be self-moderating in that area before lawyers need to get involved (as even the most friendly lawyers can't make their involvement pleasant in that case). I call BULLSHIT. No one is forcing these guys to use their business e-mails for reading these groups. It doesn't matter what email address is used. It's the person behind the email address that matters. True, but I don't see what can stop me from setting up a blab...@gmail.com account, accessing it on https://gmail.com with an HTTP tunneling I've setup at home, and using it from work (or simply browsing the newsgroup via VNC at home). Sure you can do that. My point is not that we can't try to hide our activities or identities, but that we *should not* hide them. We should not masquerade as someone else in order to participate in conversations that are not appropriate for us as Google employees to participate in. I also call bullshit because these people could, for example, google for parent, accidentally make a typo and type patent (r and t are close to each other) and eventually see some patent-related stuff, which wasn't supposed to be seen. That is completely different from signing up using a fake identity. In any case, since Elan suing Apple has nothing to do with the SDK, this discussion remains off-topic for this group. Please take it somewhere else. --~--~-~--~~~---~--~~ 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 the ID of a ListView row item from a button click
Why are you wrapping each checkbox in its own linearlayout? On Tue, Apr 7, 2009 at 10:35 AM, e-satis info.ksam...@googlemail.comwrote: Hello, Each row of my view look like that : LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:id=@+id/row_layout LinearLayout android:id=@+id/row_checkbox_container CheckBox android:id=@+id/row_checkbox / /LinearLayout LinearLayout android:id=@+id/item_title_container TextView android:id=@+id/item_title/ /LinearLayout LinearLayout android:id=@+id/right_arrow_container ImageButton android:id=@+id/arrow / /LinearLayout /LinearLayout When I click on the ImageButton arrow, I trigger a method than need the id of the row to perform. By ID I mean the value of the field _id of the corresponding record in database. I did not find a direct way to do it, but I think I can if I get the index of the row in the ListView. Again, I don't know how to get this index from a click to a childview. Any help much appreciated ! --~--~-~--~~~---~--~~ 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: uninstall vs. upgrade
Which is really a bug in the application. If an application updates its database schema, it should include code to migrate old versions of the database to the new schema. On Tue, Apr 21, 2009 at 5:26 PM, Dan Pou daniel@gmail.com wrote: As a side note, the SQLite db seems to be a frequent source of install problems for apps. Often developers change the layout and require the user to uninstall and re-install apps. On Tue, Apr 21, 2009 at 7:11 PM, JP joachim.pfeif...@gmail.com wrote: An uninstall/install cycle will wipe the SQLite db and the preferences. The only (reasonable) way to keep user data is through an upgrade. You can test an upgrade by posting the new version (new apk file) on a web site of yours and install it as a non-market app through Android's browser. Once the download begins, the process of installing the app converges. Posting on a web site needs the following MIME setting there: application/vnd.android.package-archive On Apr 21, 4:28 pm, havexz bali.param...@gmail.com wrote: Hi Well i dont know is there a way of testing the upgrade without putting it on the market, but I can clarify few of the issues. The database wont be delete when the market is upgrading. It keeps the user data intact only the application binary is deleted and new installed. On Apr 21, 4:52 pm, yves...@gmail.com yves...@gmail.com wrote: I have an application which stores data in preference (to save initial settings) and sqllite database. So, if uninstall the application (through market), will the preference and database be deleted? how about upgrade? Is there a way for me to test this before I upload my upgrade to the market? I don't want people report that they have to re- setup everything and the data in sqllite Database is missing. --~--~-~--~~~---~--~~ 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: Why corsor need to call setNotificationUri when query from content provider?
On Wed, Apr 22, 2009 at 2:48 AM, aby orz0...@gmail.com wrote: In the sample code of android developer http://developer.android.com/reference/android/content/ContentProvider.html When query the content provider, the cursor in query () call setNotificationUri(getContext().getContentResolver(), uri). But the query is a read-data action, it doesn't need to notify uri because the database can't update when being read. is there any propose to avoid some problem adding setNotificationUri in the query function of content provider? The notification is for when the data changes after the cursor has been created, so that whoever has the cursor is notified that the data in the cursor is now stale, and the cursor should be requeried. --~--~-~--~~~---~--~~ 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: MediaPlayer sound problem
Does it work with longer sounds? Have you tried using MediaPlayer.setLooping(true) instead of restarting it yourself from the OnCompletionListener callback? On Thu, Apr 23, 2009 at 12:00 AM, BlackLight blacklight1...@gmail.comwrote: Hello. I have this task: Need to play short (0.3-0.4 sec) sounds all the time. When sound is played, it should start again, etc. User can press button to reset sound - it should stop and lunch. I did many tests. I tried to create 1 MediaPlayer, then do this: MediaPlayer.OnCompletionListener complListener = new MediaPlayer.OnCompletionListener() { public void onCompletion(MediaPlayer mp) { lunchSound(); // rewind } }; private boolean lunchSound() { try { mplayer.seekTo(0); // move to start mplayer.start(); return true; }catch(Exception e){} return false; } When user press button, I call lunchSound(); It works great on emulator and on device if I have eclipse+debugger on. When I disconnect debugger, I have very strange errors - sound can stop at all (till program restart), sound can start repeating (play 0.1-0.2 sec, then restart). Can someone please provide me some info about problem? 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: android 1.5: How do we use the AudioTrack class?
AudioTrack plays PCM data. The reason it sounds like noise is because that's what mpeg sounds like when interpreted as PCM. On Thu, Apr 23, 2009 at 3:44 PM, Moto medicalsou...@gmail.com wrote: Ok at this point I only get white noise? do I need to set the decoder? it's an MPEG stream could a AAC+ be now supporteD? --~--~-~--~~~---~--~~ 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: android 1.5: How do we use the AudioTrack class?
Use the MediaPlayer class. On Thu, Apr 23, 2009 at 6:35 PM, Moto medicalsou...@gmail.com wrote: lol yeah definitely true! But for some reason I thought it would be decoded into a playable format... How do we play AAC+ formats and MPEG formats? --~--~-~--~~~---~--~~ 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: exit button - or not?
Having a UI element for the user to select that then causes Activity.finish() to be called is no different from the user pressing the back button. In fact, this is what Activity.onKeyDown() does when you let the back key fall through. Also note that calling Activity.finish() doesn't actually quit the process, so the OS is still in charge of managing when the process goes away. On Tue, Jan 27, 2009 at 3:25 PM, Inderjeet Singh inder...@gmail.com wrote: In my app, I provide a top-level option to quit (using Activity.finish()), and I still think it is a good idea. I somehow have a feeling that this notion of OS managing everything behind the scenes is not going to work out too well in practice. Moreover, the users might prefer the option of being able to end something for good. Having said that, Dianne's point about this being a preferred style guideline makes me think again about this. Inder On Tue, Jan 27, 2009 at 12:34 PM, deepdr...@googlemail.com deepdr...@googlemail.com wrote: Hi there, I wonder: should an Android application have an exit button (or menu function) or not? Ok, if there's some service or other resources consuming something running in the background I think the user should have an option to make it stop. But what about an application that would just sit there, inactive? If I take a look at the standard application it seems that the Android philosophy is to keep the applications running and let the system decide when to stop and destroy an application idling in the background. I didn't recognize exit or quit options in the standard programs. On the other hand - why not let the user decide and give the option to quit some software if he knows it's currently not used. So, what's the advice here? Give even a passive application an exit button? Or not and just leave it to the system? thanks - -- 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. All such questions should be posted on public forums, where I and others can see and answer them. -- 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. 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: Can you play a local video not on the sdcard?
Playback/decoding actually happens in a different process (the media server), so that process needs to have permission to read your file. On Tue, Jan 27, 2009 at 4:01 PM, devileper devile...@gmail.com wrote: I can only get the VideoView to play videos on the sdcard, NOT local to my application. Is there a permission requirement to get this working or can it only access the sdcard? Working: VideoView videoView = (VideoView) findViewById(R.id.video); videoView.setPath(/sdcard/video.mp4); Not Working (Cannot Play Video): VideoView videoView = (VideoView) findViewById(R.id.video); videoView.setPath(/data/data/com.myapp/app_files/video.mp4); Log Errors: 01-27 15:56:14.920: ERROR/MediaPlayer(3341): Error (-4,0) 01-27 15:56:14.920: DEBUG/VideoView(3341): Error: -4,0 --~--~-~--~~~---~--~~ 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 mute the player when I got an incoming call?
You need to monitor the phone's state to see whether it is ringing, in-call or idle. See TelephonyManager and PhoneStateListener. On Tue, Jan 27, 2009 at 10:33 PM, manoj manojkumar.m...@gmail.com wrote: Hi friends, I have written a small player application. I want to handle incoming calls in my application. Actually while player plays some media file, if an incoming call comes, then my player should mute the volume and when the incoming call is done, the player should unmute the volume. Can anyone please tell me how to achieve this requirement? Thanks, Manoj. --~--~-~--~~~---~--~~ 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: Can you play a local video not on the sdcard?
VideoView currently only works with paths and URIs though, not file descriptors. On Wed, Jan 28, 2009 at 12:29 PM, Dave Sparks davidspa...@android.comwrote: Right, which means that you need to open the resource file in your process and pass the file descriptor in setDataSource instead of the URI. On Jan 27, 4:16 pm, Marco Nelissen marc...@android.com wrote: Playback/decoding actually happens in a different process (the media server), so that process needs to have permission to read your file. On Tue, Jan 27, 2009 at 4:01 PM, devileper devile...@gmail.com wrote: I can only get the VideoView to play videos on the sdcard, NOT local to my application. Is there a permission requirement to get this working or can it only access the sdcard? Working: VideoView videoView = (VideoView) findViewById(R.id.video); videoView.setPath(/sdcard/video.mp4); Not Working (Cannot Play Video): VideoView videoView = (VideoView) findViewById(R.id.video); videoView.setPath(/data/data/com.myapp/app_files/video.mp4); Log Errors: 01-27 15:56:14.920: ERROR/MediaPlayer(3341): Error (-4,0) 01-27 15:56:14.920: DEBUG/VideoView(3341): Error: -4,0 --~--~-~--~~~---~--~~ 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: Reg playing youtube video in android
On Thu, Jan 29, 2009 at 4:47 AM, Harishkumar V harishpres...@gmail.comwrote: Dave, I tried to play via mediaplayer example given in the sdk with the YouTube video url (http://in.youtube.com/watch?v=l43Bbn2Xpwk), That's not the URL of a video, it's the URL of a webpage which has a flash video embedded in to 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: Android 1.5 Cupcake
Did you try asking whoever it was that created the image that is not working? On Thu, Jan 29, 2009 at 12:23 AM, Koffi kakib...@gmail.com wrote: I got Cupcake images from http://nullwire.com/try_out_cupcake_yourself followed the instructions, it worked fined in the beginning, I realized Maps was no longer the home screen and API Demos and Maps were missing from applications screen too and with 1.5 I can now access SD Card phone storage in the settings setting and see my sdcard image loaded, I could not before in 1.0 I can switch between 1.0 and 1.5 by changing the system.img, userdata.img and ramdisk.img in tools/lib/images Now with the images files from 1.5 in tools/lib/images the emulator does not launch anymore it is stuck at the screen where the green android logo is glowing indefinitely, when I revert back to the 1.0 img files the emulator works as usual. Can anyone direct me as to why the emulator does not work with 1.5 anymore what might be the cause and a solution if there is one. I removed the SDK and emulator completely even eclipse I re downloaded and reinstalled eclipse, the ADT plugin, SDK and emulator. Emulator works well with 1.0 but still does not work when 1.5 img files are loaded. --~--~-~--~~~---~--~~ 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: Audio chat
You can't do that using the SDK at the moment. You might be able to hack something together using native code, but you'd either have to use AMR or provide your own encoder, and you'd also have to write your own rtsp or http server or other communications protocol. That's probably beyond the scope of this discussion group though. On Thu, Jan 29, 2009 at 12:57 AM, gunar adrian.proco...@gmail.com wrote: Hi! I have a question? Can someone give me a direction where to look to make an audio chat application? I saw some threads related to audio streaming, also other related to audio recording/playing. How to setup a RTP/RTCP/RTSP session between two Android clients? Best regards! Adrian --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---