[android-developers] Re: Clear defaults programmatically
Thanks TreKing, this is exactly what I meant. And thank you for your tip. I already have a description of how to do this manually, but never thought about opening the manage application activity. If there is no other way I will head for your proposed work around. On May 28, 8:37 pm, TreKing wrote: > On Fri, May 28, 2010 at 1:17 PM, skink wrote: > > >http://developer.android.com/intl/fr/reference/android/preference/Pre..., > >int, > > boolean) > > This is not what the OP is asking - when you execute an action, if there are > multiple activities that support that action you can choose which to use and > optionally set it as the default handler of that action. > > For example, if you have two browsers and click a link, you can choose which > to use and set one as the default so it's always called instead of giving > you the choice. However, if you later decide you no longer want that > activity to handle that action by default, you have to go through the > preferences, select the app that is the default for that action, and hit a > button to clear it as the default handler for that action. > > The OP wants to know if there is a way to programmatically do the equivalent > of going through those steps. > > This has nothing to do with an app's own preferences. > > OP - I don't know if this is possible, but as a next best thing you could > possibly tell the user what they have to do and then open the manage > application's settings page for them and let them finish the process. > > --- > -- > TreKing - Chicago transit tracking app for Android-powered > deviceshttp://sites.google.com/site/rezmobileapps/treking -- 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: Clear defaults programmatically
Is it even possible? No one knows this? I suppose many users don't know how to do this on their phones, because it is rather complicated to understand for non programmers. I want to give my users the option to clear defaults of my app, within my app. But how do I do this? On Apr 19, 3:01 am, Bonifaz wrote: > This clears the preferences, but not the default flag set by a user > when a Intent Chooser is shown to him/her. > Am I right? > > How can I get back the Intent Chooser Dialog when a user previously > set my app as default. I know you can go to Manage Applications and > click "clear defaults" but how do I do this in code? > > On Apr 18, 3:01 pm, Menion wrote: > > > > > > > I'm using this code ... hope it helps > > > PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commi > > t(); > > > On Apr 16, 11:09 am,Bonifaz wrote: > > > > Does anyone know > > > how to clear defaults of my own app by code. > > > > I know that a user can always go to Manage Applications, find my app > > > and click the button there to clear previously assigned default > > > actions. But for most users this isn't intuitive at all. > > > > I would like to offer my customers a solution to clear defaults within > > > my own app if they don't like to use my app as a replacement for a > > > specific action anymore. > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to android-developers@googlegroups.com > > > To unsubscribe from this group, send email to > > > android-developers+unsubscr...@googlegroups.com > > > For more options, visit this group > > > athttp://groups.google.com/group/android-developers?hl=en > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: API 8 (Froyo) changed lockpattern setting
It is really a shame, two of my apps are also relying on the LOCK_PATTERN_ENABLED setting not to be a secure settings (which clearly wasn't before). How can I trust that my apps will work in future when such important details simply change. I already see customers complaining about my app not beeing compatible anymore, and I cannot do a little thing about it. Very disappointing! On May 24, 7:47 pm, Mark Murphy wrote: > Willem wrote: > > My users seem complaining that my lockpattern plugin for locale does > > not work anymore. It turns out that the setting LOCK_PATTERN_ENABLED > > is moved from Settings.System to Settings.Secure. Since secure > > settings are read only my application becomes pretty useless in > > android 2.2... > > > I understand that the lockpattern setting is a secure setting. But it > > was a system setting before.. Isn't strange that the API developers > > just changed this?!? > > Not particularly. They moved a bunch to Settings.Secure when they set it > up back in Android 1.5. I expect they will continue to do this when they > determine that it is too risky to leave in Settings.System, either due > to malware or user complaints. > > > Is there a way to write secure > > settings anyway? > > Not for ordinary SDK applications. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 2.0 Available! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Clear defaults programmatically
This clears the preferences, but not the default flag set by a user when a Intent Chooser is shown to him/her. Am I right? How can I get back the Intent Chooser Dialog when a user previously set my app as default. I know you can go to Manage Applications and click "clear defaults" but how do I do this in code? On Apr 18, 3:01 pm, Menion wrote: > I'm using this code ... hope it helps > > PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commi > t(); > > On Apr 16, 11:09 am,Bonifaz wrote: > > > > > > > Does anyone know > > how to clear defaults of my own app by code. > > > I know that a user can always go to Manage Applications, find my app > > and click the button there to clear previously assigned default > > actions. But for most users this isn't intuitive at all. > > > I would like to offer my customers a solution to clear defaults within > > my own app if they don't like to use my app as a replacement for a > > specific action anymore. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Clear defaults programmatically
Does anyone know how to clear defaults of my own app by code. I know that a user can always go to Manage Applications, find my app and click the button there to clear previously assigned default actions. But for most users this isn't intuitive at all. I would like to offer my customers a solution to clear defaults within my own app if they don't like to use my app as a replacement for a specific action anymore. -- 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: Accessing contact's phone numbers
Thank you Dmitri, this answer saves me a lot of time. On Dec 2, 12:41 am, Dmitri Plotnikov wrote: > Just to clarify the Facebook question: the FB contact data is not visible to > any applications except a handful of built-in apps like Contacts. That's a > policy decision by Facebook. > > At the same time, any application can read and write data from all other > types of accounts, including Google and Exchange (aka Corporate) > > Thanks, > Dmitri > > On Dec 1, 2009 9:31 PM, "Bonifaz" wrote: > > I still don't know how to query Facebook contacts and their phone > numbers. > Could please someone give me a hint about this. If I query > Contacts.CONTENT_URI, it returns all contacts but not Facebook > contacts. > > -- You received this message because you are subscribed to the Google Groups > "Android Developers" ... -- 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: Accessing contact's phone numbers
I still don't know how to query Facebook contacts and their phone numbers. Could please someone give me a hint about this. If I query Contacts.CONTENT_URI, it returns all contacts but not Facebook contacts. -- 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 2.0] Accessing contact's phone numbers
How do we then get all contacts/phonenumbers from all accounts? If I use the new Contacts API and send an ACTION.PICK for phone numbers like Intent i = new Intent(Intent.ACTION_PICK, android.provider.ContactsContract.CommonDataKinds.Phone.CONTENT_URI); it doesn't give me for example Facebook account phone numbers. even Intent i = new Intent(Intent.ACTION_PICK, android.provider.ContactsContract.Contacts.CONTENT_URI); doesn't show a list of all available contacts from all accounts (again I tried with Facebook contacts and they didn't show up). Dianne, could you please tell us how we use the PICK intent to get a list of all available phone numbers from all accounts. This would be really helpful. On Nov 17, 3:31 pm, Dianne Hackborn wrote: > On Fri, Nov 6, 2009 at 6:31 PM, Ravi wrote: > > Now 2.0 Breaks every thing. > > Wow that's pretty over-the-top. The original contacts API still works, as > long as you weren't using private parts of it, and only for the primary > Google account. So it still gives you the same functionality (the new > feature of additional accounts is not accessible from it, but that is why a > new API was required) as before. And as we've said repeatedly for > everything, if you use private APIs you will break in the future, so that > shouldn't be a surprise. > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: [Android 2.0] Contacts FAQ?
A Blog entry about the new Contacts API from Google covering these points would be 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: Android 2.0 SDK is here!
This sounds great. I was fevered waiting for Bluetooth RFCOMM. Thanks so much! Multi-touch is also awesome. --~--~-~--~~~---~--~~ 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: (unofficial) Bluetooth API v. 0.2
Great job Stefanno, your library helps me a lot!!! I also use your library (RFCOMM) already. The only thing I found is, that when I try to pair to a device which is offline the library still calls the callback method paired(). LocalBluetoothDevice(15638): _localDevice is NOT null BluetoothBroadcastReceiver(15638): Registering LocalBluetoothDevice(15638): 00:07:44:99:4E:50 is already paired LocalBluetoothDevice(15638): creating new BluetoothSocket for 00:07:44:99:4E:50 on port 1 You can see it even creates a BluetoothSocket, so how do I figure out if a device is successful connected or not? If I try to write to the socket it tells me in the log that the host is down, however it does not raise an exception which I can catch. ERROR/bluetooth_RfcommSocket.cpp(15717): connect error: Host is down (112) Any ideas? Bonifaz --~--~-~--~~~---~--~~ 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: Accelerometer/Orientation sensor problem
I have the same problem of wired accelerometer data while music is playing. Does anyone have a workaround for this. Some kind of filter mechanism perhaps. I use "FloatMath.sqrt(x*x + y*y + z*z)" for shake detection. But even with that formular, playing music always detects shake, just raising the threshold won't work, since shake would not be detected with to high threshold. --~--~-~--~~~---~--~~ 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: URGENT!!!!! Can't update apps in android market!!!
This does the trick! >> You may move the >> >> to the first line, after the . --~--~-~--~~~---~--~~ 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 permission required to toggle the phone GPS setting?
Use should this one. --~--~-~--~~~---~--~~ 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: Theme.NoDisplay raises RuntimeException
Yes I do that, I call finish() within onCreate()! But it raises a java.lang.Runtime Exception! I found a workaround: Now I define an own Style with parent Theme.Dialog and override the attributes which are defined in Theme.NoDisplay. However, Theme.NoDisplay should work without Exception, shouldn't 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: Error eclipse open layout xml
I had the same error once. It was the '\' char at the end of a string resource. --~--~-~--~~~---~--~~ 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] Theme.NoDisplay raises RuntimeException
When I apply android:theme="@android:style/Theme.NoDisplay" to my application (inside manifest.xml) I get a RunTimeException saying the layout_height attribute is not specified (see below). However, is this not the reason why we have Theme.NoDisplay, not to have any layout within an app? I do not need a layout in my activity, therefore I do not call setContentView at all. Anyway, if I call setContentView with an empty FrameLayout (layout_height set to wrap_content), it does not work either. As soon as I set Theme.NoDisplay the Exception raises. My activity calls finish() at the end of onCreate(). What do I have to do to get rid of this exception? Am I something missing? --- WARN/WindowManager(577): java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. --~--~-~--~~~---~--~~ 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: Start a service from Launcher
I want to write an application which behavs similar to those toggleXXX (wifi, gps, etc..) already on the market. As you watch carefully, they do not start an activity. How can this be done. On 17 Apr., 16:48, "Mark Murphy" wrote: > > Is it possible to start a service directly from the launcher by > > clicking the application icon? > > Services do not have application icons, AFAIK. Only activities do. > > > Any clue how to get the icon into the launcher. > > Write an activity that, in onCreate(), calls startService(), then finish(). > > However, if this is an application for the Android Market, users may give > you low ratings, saying your application is broken, if you do not provide > more in an activity than that. Consider making a useful activity to > accompany your service, just so users have a better sense for what it is > they downloaded and what benefit it is providing to them. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Start a service from Launcher
Is it possible to start a service directly from the launcher by clicking the application icon? I have no activity just a single service which I want to start when I click on the icon, however when I specify my service's intent-filters it seems that it will not be recognised from the launcher, therefore no icon is visible in android's launcher. Any clue how to get the icon into the launcher. --~--~-~--~~~---~--~~ 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
Have a look at "android-sdk-windows-1.1_r1\tools\lib\res\default \drawable". I suppose these are the public drawables. On Mar 20, 3:42 pm, "Mark Murphy" 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. However, that implies that developers know how to reference > the stock option menu icons, which implies the existence of some sort of > documentation. > > We do not necessarily need the core Android team to develop the > documentation, but we do need the algorithm for deducing if a resource is > deemed "in the public SDK" or not. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] size of statusbar
Hi all! Could please anyone tell me how to get the size (in particular the hight) of the statusbar or even the size of the free display area below. Display.getHeight() returns the entire display height, but I need to know excacly how much space is left. Hence, display.getHeight()-statusbar.getHeight() would be some kind of workaround. But for that I have to know how to query the statusbar height. Does any anyone know a solution? So long Bonifaz --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---