[android-developers] Ringtone from the RingtoneManager always returns null
Hey all, I have this piece of code to enumerate the ringtones on the system: RingtoneManager rm = new RingtoneManager(this); Cursor c = rm.getCursor(); c.moveToFirst(); while(!c.isAfterLast()){ Uri geller = rm.getRingtoneUri(c.getPosition()); Log.d(TAG,path: +geller); Ringtone rt = RingtoneManager.getRingtone(this, geller); Log.d(TAG,rt: +rt); Log.d(TAG, Ringtone: +rm.getRingtone(c.getPosition())); c.moveToNext(); } c.deactivate(); But the RingtoneManager always returns null. Here's some log-output: 01-15 13:48:51.414: DEBUG/CallReceiverActivity(315): path: content://media/internal/audio/media/1 01-15 13:48:51.503: DEBUG/MediaPlayer(315): Couldn't open file on client side, trying server side 01-15 13:48:51.613: ERROR/MediaPlayerService(31): Couldn't open fd for content://media/internal/audio/media/1 01-15 13:48:51.613: ERROR/MediaPlayer(315): Unable to to create media player 01-15 13:48:51.623: ERROR/RingtoneManager(315): Failed to open ringtone content://media/internal/audio/media/1 01-15 13:48:51.623: DEBUG/CallReceiverActivity(315): rt: null 01-15 13:48:51.764: DEBUG/MediaPlayer(315): Couldn't open file on client side, trying server side 01-15 13:48:51.834: ERROR/MediaPlayerService(31): Couldn't open fd for content://media/internal/audio/media/1 01-15 13:48:51.845: ERROR/MediaPlayer(315): Unable to to create media player 01-15 13:48:51.845: ERROR/RingtoneManager(315): Failed to open ringtone content://media/internal/audio/media/1 01-15 13:48:51.845: DEBUG/CallReceiverActivity(315): Ringtone: null As you can see, the MediaPlayer is unable to open the file. Should I have extra permissions? Is anything else preventing me from accessing the file? Would appreciate help :) Regards, Daan -- 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: Reliable GPS location
You can use Location.getTime() this returns the UTC time of this fix, in milliseconds since January 1, 1970. Then you could get the current time and compare it to see if you find it accurate enough. On Jan 4, 10:14 pm, Lance Nanek lna...@gmail.com wrote: You can call Location#getTime to see when the fix returned by LocationManager#getLastKnownLocation was taken. The getLastKnownLocation method doesn't start the GPS, so the fix may be from a long time ago, and not be a good indicator of the current location. The accuracy of the fix refers to the accuracy at the time the fix was taken. I don't see how it could be easily updated to refer to the accuracy with respect to the current location. That would require starting the GPS and taking another fix to find the current location, in which case the new fix would become the last known location and there would be no point. If you want current fixes, use the LocationManager#requestLocationUpdates methods. On Jan 4, 6:07 am, nr1 ti08m...@gmail.com wrote: Hi, i know how to get the calculated GPS position via getLastKnownLocation (). As tests show, this function really always returns the last known location, so it doesn't matter if there is a gps fix available. How can i check if the returned location is reliable? I tried it with getAccurracy(), but this function even returns a accurracy although no gps fix is availavle (anymore). Is there a possibility to get gps dop values? Used SDK is 1.6, thx -- 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 development with PHP
I am using something similar. I have a PHP script online, I give my parameters by using $_GET, then I let my PHP do the work and write my output to an XML code which I read again on Android. Small sample: //Creating URL URL cUrl = null; String url = http://www.link.com?paramater=hi;; try { cUrl = URI.create(url).toURL(); } catch (MalformedURLException e) { } //Creating XML document DocumentBuilder builder = DocumentBuilderFactory.newInstance ().newDocumentBuilder(); //Read the XML document Document doc = builder.parse(cUrl.openStream()); //Getting all tags which have TagName as name and get the value of the first element. NodeList nodes = doc.getElementsByTagName(TagName); String value = nodes.item(0).getNodeValue(); On Jan 5, 12:24 am, Miguel Morales therevolti...@gmail.com wrote: You can write an applications backend in php, but why would you want to use php to write for the phone? The main language is java though apps can be written in c/perl/python/lua, but no php yet afaik. On Jan 4, 2010 12:13 PM, androidbeginner sahayamj.m...@gmail.com wrote: Is it possible create android applications using PHP? can we port php code in to the android applications? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Modify XML Layout using classes
I am trying to change the order of views. The views should get into into a specific order according to the user's preferences. So let's say I have three text-views in a linear-layout, how can I can I change the order so Android will show the text-views in a different order thans declared in the XML file. I couldn't find anything so I hope you could help me out by sending a sample code or a page I could use. Thanks in advantage. -- 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 is my eclipse up to date with 2.0.1 but no android tools appear in the UI?
I am on Windows 7 too, but didn't have any problem installing the Android SDK. Try watching this video http://www.youtube.com/watch?v=lqPfi6N4iEY and see if you missed out any steps. It's Windows XP, but it doesn't matter it works the same as Vista and 7. On Jan 4, 11:24 pm, ClarkBattle clarkbat...@gmail.com wrote: I am installing on Windows 7. Window Preferences... Android is not there, even though the tools are installed. Reinstalling Eclipse does not fix the problem. On Jan 4, 1:10 pm, ClarkBattle clarkbat...@gmail.com wrote: I was completely set up with android 2.0 and eclipse. Everything worked fine. Then I tried to upgrade to 2.0.1 and now eclipse wont show any of the android plug in stuff. There is nothing in the IDE relating to android anymore. No AVD, no android projects, nothing. If I go to Help - Install New Software, select Android Eclair -https://dl-ssl.google.com/android/eclipse/; for the Work with, and look under Developer Tools I get these: Android DDMS 0.9.5.v200911191123-20404 Android Development Tools 0.9.5.v200911191123-20404 These are the mot current android 2.0.1 tools. It shows that they are already installed (clicking the Hide items that are already installed box removes them). However, eclipse looks like i just installed it vanilla with no plugins at all. Is there something else I need to do? Check for Updates says there is nothing to update. Should I blow away eclipse and reinstall it from scratch? Doesnt that defeat the purpose of the automatic updater? Confused -- 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