[android-developers] How do I enable the phone's key guard programmatically?

2010-05-11 Thread Walles
Hi! How do I enable the phone's key guard programmatically? The use case is that I want to make an app that enables the key guard when I use my Bluetooth headset to answer a call. Currently with my HTC Hero there's no way for me to physically enable the key guard during a call since the phone's

[android-developers] Re: Android 2.0 source group

2009-12-01 Thread Walles
This might be a bit crude, but what I usually do is this: 1. Search Google for: mediarecorder.java site:.kernel.org 2. Click on the first hit. 3. Find MediaRecorder.java on that page and click on the "blob" link next to it. 4. Click on HEAD. I've always found the source code I wanted this way.

[android-developers] Re: Where do I write my changelog?

2009-11-07 Thread Walles
To answer my own question in case somebody else wants to know, what people do is simply to change the description of the app after every release, so that it includes a description of the latest change. On 23 Sep, 12:00, Walles wrote: > Hi! > > When upgrading apps I've downloaded fr

[android-developers] Re: What does the Location accuracy mean?

2009-11-06 Thread Walles
The wiki page says it's a radius if I interpret it correctly: " In order to apply the CEP concept in these conditions, we can define CEP as the [...] radius of a circle within which 50% of rounds will land. " Or am I skipping too much text in between there? :-) //Johan On 6 Nov, 07:07, "Maps.Hug

[android-developers] What does the Location accuracy mean?

2009-11-05 Thread Walles
If I do Location.getAccuracy() I get a number of meters. Is that number a radius or a diameter? I thought it would be a radius, but Google's MyLocationOverlay uses that value as a diameter. Regards //Johan -- You received this message because you are subscribed to the Google Groups "Android

[android-developers] Re: INSTALL_FAILED_MISSING_SHARED_LIBRARY

2009-11-02 Thread Walles
The device you're running on must have the Google API things installed, make sure the AVD description says something about Google. AVD setup is described here: http://developer.android.com/guide/developing/tools/avd.html Try reading the blue box at the top of http://developer.android.com/guide/t

[android-developers] How to style a Button to look like a Spinner?

2009-10-26 Thread Walles
Hi! I want to create a Button that looks like a Spinner. Programmatically, this works fine: Button button = new Button(this, null, android.R.attr.spinnerStyle); How can I do the same thing in my layout XML files? Regards //Johan --~--~-~--~~~---~--~~

[android-developers] How to connect a context menu to a spinner popup?

2009-10-12 Thread Walles
ner itself rather than the list it pops up. Help! //Johan Spinner setup code: http://bazaar.launchpad.net/~walles/sl/trunk/annotate/49/StockholmPublicTransport/src/com/johan/sl/SL.java#L140 Spinner XML (it's the fromSpinner and the toSpinner that I want to provide with conte

[android-developers] Geocoder.getFromLocationName() has bad javadocs

2009-10-11 Thread Walles
There is a Geocoder.getFromLocationName(name, max, lat, lon, lat, lon) method. The documentation says it should search inside the (lat, lon, lat, lon) bounding box: http://developer.android.com/reference/android/location/Geocoder.html#getFromLocationName(java.lang.String, int, double, double, dou

[android-developers] Re: Geocoder.getFromLocationName() ignores bounding box

2009-10-08 Thread Walles
ttp://maps.google.com/maps?f=q&source=s_q&hl=sv&geocode=&q=storgatan+5&sll=59.333857,18.087831&sspn=0.004367,0.00825&ie=UTF8&hq=&hnear=Storgatan+5,+11444,+Sverige&ll=59.33569,18.080717&spn=0.004366,0.00825&z=17 //Johan On 8 Okt, 19:32, Walles wrote:

[android-developers] Re: Geocoder.getFromLocationName() ignores bounding box

2009-10-08 Thread Walles
I'm looking for). Help! //Johan On 8 Okt, 10:36, Nithin wrote: > hi Walles, > > geocoder.getFromLocationName(locationName, 5); will return a list of > values and here, 5 is the no. of results(values) we want. So according > to that we can get the corresponding latitude and longi

[android-developers] Re: Geocoder.getFromLocationName() ignores bounding box

2009-10-08 Thread Walles
ER_RIGHT_LAT, SL_UPPER_RIGHT_LON); Regards //Johan On 8 Okt, 10:36, Nithin wrote: > hi Walles, > > geocoder.getFromLocationName(locationName, 5); will return a list of > values and here, 5 is the no. of results(values) we want. So according > to that we can get the corresponding lat

[android-developers] Geocoder.getFromLocationName() ignores bounding box

2009-10-07 Thread Walles
How can I convert a street address into a latitude + longitude? I've tried to use Geocoder.getFromLocationName() with a bounding box, but all results I get are outside of the box. Is there a way to limit the hits to a certain area on earth? Regards //Johan --~--~-~--~~--

[android-developers] Geocoder.getFromLocationName() vs bounding box?

2009-10-04 Thread Walles
Hi! I'm trying to use Geocoder.getFromLocationName() with a bounding box, but: * On 1.5 I get lots of results outside of my box. * On 1.6 I get no results at all. How should I use Geocoder.getFromLocationName() with a bounding box so that I get results inside of the box but not outside of it? H

[android-developers] Re: WebView onLoadComplete()?

2009-09-28 Thread Walles
Thanks Mark, that was exactly what I needed. You rule. Cheers :-) //Johan On 27 Sep, 17:23, Mark Murphy wrote: > Walles wrote: > > I have aWebViewthat I've asked to load a page usingwebView.loadUrl > > (). > > > How do I get a notification when th

[android-developers] WebView onLoadComplete()?

2009-09-27 Thread Walles
I have a WebView that I've asked to load a page using webView.loadUrl (). How do I get a notification when the WebView has completed loading + rendering the requested page? The closest I've gotten is webView.getProgress(), but I'd like to be notified rather than having to poll for that value to

[android-developers] Where do I write my changelog?

2009-09-23 Thread Walles
Hi! When upgrading apps I've downloaded from Market, I'm sometimes presented with a list of changes since the last version. When I publish my own apps, where am I supposed to list my changes for the Market app to show them to potential upgraders? Regards //Johan --~--~-~--~~-

[android-developers] Re: Location constructors are stubs?

2009-09-22 Thread Walles
still looks the same in Eclipse, thank you Eclipse ADT plugin developers :-). //Johan On 21 Sep, 08:27, Walles wrote: > Hi! > > I'm writing unit tests for a class containing Locations.  To create a > (mock) Location, I do this: > > Location from = new Location(&qu

[android-developers] Location constructors are stubs?

2009-09-20 Thread Walles
Hi! I'm writing unit tests for a class containing Locations. To create a (mock) Location, I do this: Location from = new Location("Johan"); However, the Location(String) constructor throws a RuntimeException saying "Stub!". How can I create a mock location? Note that I'm running this on the

[android-developers] Re: How do I know whether my device is currently charging?

2009-09-20 Thread Walles
ery, non-zero is the power source), which is generally what things use > to determine whether the device is plugged in (so it is okay to do more > power drawing operations). > > > > On Sat, Sep 19, 2009 at 12:42 PM, Walles wrote: > > > Thanks Mark, that was the hint I neede

[android-developers] Re: How do I know whether my device is currently charging?

2009-09-19 Thread Walles
ot;Failed to get battery charging status, assuming we're on battery power"); return true; } return batteryStatus == BatteryManager.BATTERY_STATUS_DISCHARGING; } " Cheers //Johan On 18 Sep, 11:54, Mark Murphy wrote: > Walles wrote: > > I

[android-developers] How do I know whether my device is currently charging?

2009-09-17 Thread Walles
I want to know if my device is currently charging. How do I find that out? I've been looking a bit at the Intents API, but AFAIU I can just subscribe to events from there, and a subscription is not what I'm after. And even if I *did* want updates, I'd still need to know the initial state. I ju

[android-developers] Re: Probing for an already set Alarm?

2009-09-17 Thread Walles
e the ONLY one scheduling your own > alarms.  Nobody is changing them behind your back.  You know exactly what > you are doing.   So just write it to do exactly what you want. > > > > On Wed, Sep 16, 2009 at 4:43 AM, Walles wrote: > > > Let's say I change my code to:

[android-developers] Re: Probing for an already set Alarm?

2009-09-16 Thread Walles
urther improve by > using a Handler, thread or Async Task to collect your second sample > after a 15s sleep and then trigger a repeating alarm every ten minutes > thereafter.  To be clear, a phone reboot will cancel the repeating > alarm but you can catch the event and restart. > > G

[android-developers] Re: Probing for an already set Alarm?

2009-09-15 Thread Walles
t; monitor CPU usage, network usage, wakelock usage, screen usage, etc, etc. > > > > On Tue, Sep 15, 2009 at 5:02 AM, Walles wrote: > > > Good point :-), here's the plan: > > > I'm writing an app to find out what apps are using the most CPU time > > (w

[android-developers] Re: Probing for an already set Alarm?

2009-09-15 Thread Walles
On 16 Sep, 05:26, Beth wrote: > What does the background service do, exactly?  Sorry, I don't really > want to sort through the two versions of your code. It has a thread that wakes up regularly to take a snapshot of /proc: http://bazaar.launchpad.net/~walles/drain-o-meter/trunk/an

[android-developers] Re: Probing for an already set Alarm?

2009-09-15 Thread Walles
Good point :-), here's the plan: I'm writing an app to find out what apps are using the most CPU time (which I hope will correlate with battery drain). It's possible to get a snapshot picture of this by looking at /proc: http://bazaar.launchpad.net/~walles/drain-o-meter/trunk/a

[android-developers] Getting longer stack traces from DDMS?

2009-09-11 Thread Walles
I read this blog about how to use DDMS to track memory allocations. http://android-developers.blogspot.com/2009/02/track-memory-allocations.html Using those instructions, I was able to get allocation stack traces. Unfortunately the stack traces only go 8 deep (at least when running against the s

[android-developers] Re: How to improve existing Android applications?

2009-09-11 Thread Walles
The answer I was really looking for was this: http://source.android.com/using-eclipse Having a pointer to there from the developer FAQ would be nice. /J On 18 Aug, 10:11, Walles wrote: > How do I get (for example) the Android Calendar app into Eclipse so I > can modify it and s

[android-developers] Re: Probing for an already set Alarm?

2009-09-09 Thread Walles
I'll use a Service instead of an Alarm and keep it running in the background. That way I can keep track of it myself. Thanks for the input! Cheers /J On 8 Sep, 07:34, Walles wrote: > Hi! > > How can I probe for whether a specific alarm has been set?  I set the > alarm as

[android-developers] Probing for an already set Alarm?

2009-09-07 Thread Walles
rmManager.RTC, later, pendingIntent); } Full sources available at http://bazaar.launchpad.net/~walles/drain-o-meter/trunk/annotate/head%3A/src/net/launchpad/drainometer/Updater.java#L72 if needed. Thanks //Johan --~--~-~--~~~---~--~~ You received this mes

[android-developers] How to improve existing Android applications?

2009-08-18 Thread Walles
How do I get (for example) the Android Calendar app into Eclipse so I can modify it and send in patches? There's a ton of documentation on how to create *new* apps, but so far I've been unable to find any info on how to get *existing* apps into Eclipse. And my own attempts have gone so-so :-p.