[android-developers] Re: how to learn android?

2011-09-12 Thread davemac
We've received quite a few very good reviews of Pro Android 3 (Apress). I'm a co-author along with Satya Komatineni. Available in print and ebook formats here: http://www.apress.com/9781430232223 and at Amazon: http://www.amazon.com/Pro-Android-3-Satya-Komatineni/dp/1430232226 This is probably

[android-developers] Re: Soundpool problem

2011-08-23 Thread davemac
SoundPool isn't designed to work with that much sound. The internal buffer is around 1MB, and that's after decompression from the source file. If you really want to use SoundPool, you're going to have to use less sound. You could try a shorter clip, smaller frequency (8 instead of 44), mono

[android-developers] Re: Simulate GPS Failure

2011-08-23 Thread davemac
You might try holding it inside your kitchen oven (oven not turned on of course). - dave On Aug 23, 9:07 pm, burton miller burton.mil...@gmail.com wrote: I'm not sure about the type of failure, because it does not happen in my code - it happens in the advertiser's code, and some of my users

[android-developers] Re: Can I use drawable-small, large, xlarge instead of hdpi, mdpi, ldpi?

2011-08-14 Thread davemac
You should keep the following in mind: a larger screen does not necessarily mean a higher pixel density screen. And that's the big reason why you can't just consider screen size and not screen density. I don't think one exists, but in theory you could have an xlarge screen device with a low pixel

[android-developers] Re: Wrote stack trace to '/data/anr/traces.txt'

2011-08-04 Thread davemac
What TreKing said. Did you notice this helpful information in the stacktrace: For ExpandableListView, use setAdapter(ExpandableListAdapter) instead of setAdapter(ListAdapter) Try changing that. - dave http://www.androidbook.com/proandroid3 On Aug 4, 6:25 pm, TreKing treking...@gmail.com wrote:

[android-developers] Re: how to edit layout file at runtime

2011-08-04 Thread davemac
Without knowing the specifics of what you're trying to do, it's difficult to advise you. However, it's very possible that what you really want to do is create a suitable number of layouts depending on expected device configurations. That way, you don't need to worry about dynamically setting up a

[android-developers] Re: Comments in market place

2011-08-04 Thread davemac
You could address the spyware issue with a comment in an updated description of your app. It's not the ideal solution, but it's an option. - dave http://www.androidbook.com/proandroid3 On Aug 4, 6:18 pm, Kevin Duffey andjar...@gmail.com wrote: All three of these are good. I really don't get the

[android-developers] Re: Trying to get the URI for all non media document in API level 8

2011-08-04 Thread davemac
See this provider: http://developer.android.com/reference/android/provider/MediaStore.Files.html - dave http://www.androidbook.com/proandroid3 On Aug 3, 5:19 am, Debabrata debabrata.hazar...@gmail.com wrote: Hi All, Is there any URI or DB maintained by the android provider(in    FROYO or

[android-developers] Re: Trying to get the URI for all non media document in API level 8

2011-08-04 Thread davemac
Doh! Wrong one (that one was 11 not 8). Try this one and query the mime_type: http://developer.android.com/reference/android/provider/MediaStore.MediaColumns.html - dave On Aug 4, 9:57 pm, davemac davemac...@gmail.com wrote: See this provider: http://developer.android.com/reference/android

[android-developers] Re: How to delete a video file's entry from content provider

2011-08-04 Thread davemac
Check this out: http://stackoverflow.com/questions/4430888/android-file-delete-leaves-empty-placeholder-in-gallery - dave http://www.androidbook.com/proandroid3 On Aug 4, 10:33 am, Raj bande.rajki...@gmail.com wrote: Hello, In my app, I've moved the recorded video to some other location. When

[android-developers] Re: Searching for Tawk does not match my app of that name but all other apps with the word Talk in them

2011-08-01 Thread davemac
If you're referring to Android Market's search, you'll probably need to post on their forum site: http://www.google.com/support/forum/p/Android+Market and then hope that someone gets back to you with an answer. Good luck! - dave On Aug 1, 6:36 pm, Godalot mze...@gmail.com wrote: I'm having a

[android-developers] Re: Pre - installed sqlite data vs user provided values

2011-07-25 Thread davemac
Yes, but he wants to be able to easily update the packaged part of the database, and he's not wanting to deal with record data outside of a sqlite db in the update. I suppose if you were to use the special flag column, you could extract out the user's rows, replace the packaged db with your new

[android-developers] Re: Problem launching a basic application using GMaps on Android emulator

2011-06-30 Thread davemac
You can very likely ignore the first dialog. The emulator can run very slowly and will often complain about things not responding, especially when you first start it. Like the keyboard. The second dialog is the one you want to investigate using logcat. Since you're using maps and working from

[android-developers] Re: How to Implement Drag And Drop for image views by extending View Group

2011-06-23 Thread davemac
Are you doing this in Android 3 or an earlier version? There's direct support for drag and drop since Android 3.0 so it's much easier. See the DragEvent class. But it's possible prior to Android 3.0, just harder. - dave http://www.androidbook.com/proandroid3 On Jun 22, 11:57 pm, ram dharan

[android-developers] Re: Speech Recognition in Android

2011-06-23 Thread davemac
Recognizing speech is really hard to do well. What you get with Google's Android Recognizer is pretty good. If you want to consider another, you could look at Sphinx. - dave www.androidbook.com/proandroid3 On Jun 23, 6:05 pm, Droid rod...@gmail.com wrote: The speech recogniser often makes

[android-developers] Unique ID for a device: why aren't devices certified Android-compliant?

2011-03-31 Thread davemac
Tim Bray posted the following on the Android Developers Blog: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html?utm_source=feedburnerutm_medium=feedutm_campaign=Feed%3A+blogspot%2FhsDu+%28Android+Developers+Blog%29utm_content=Google+Feedfetcher In it, he describes

[android-developers] Re: Unique ID for a device: why aren't devices certified Android-compliant?

2011-03-31 Thread davemac
app? And lastly, think of the actual price of software with relation to people earnings. Markets only convert the price using actual currency exchange rates. To some USD0.99 is still a day's work. Daniel On Thu, Mar 31, 2011 at 12:35 PM, davemac davemac...@gmail.com wrote: Tim Bray

[android-developers] Re: Populate Spinner from database

2011-03-12 Thread davemac
As you appear to be using a single text view in your spinner, consider using some standard layouts and views. Instead of R.layout.profile_list, try using android.R.layout.simple_list_item_1, and instead of your R.id.tvDBViewRow, replace that with android.R.id.text1. My guess is that you're getting

[android-developers] Re: Fragment Support forward compatibility?

2011-03-10 Thread davemac
There are some subtle differences between the Fragment compatability library and the native Fragment support in Android 3.0. For example, the setCustomAnimations() method on FragmentTransaction can use the new ObjectAnimator in Android 3.0 (see android.R.animator), but must use the older anim

[android-developers] Re: Can you use include / with @layout-land?

2011-03-07 Thread davemac
Did you try creating layout/mylargelayout.xml, then include that from within layout-large/mylayout.xml and from layout-xlarge/mylayout.xml ? In your code, you'd always refer to mylayout, but for large and xlarge, it would end up looking for mylargelayout which would be found in layout. I haven't

[android-developers] Re: NFC question: card emulation is not supported in the Android SDK yet, right?

2011-03-07 Thread davemac
to go. We have just one API call for this now - NfcAdapter.enableForegroundNdefPush() but it is surprisingly powerful. Nick On Fri, Feb 25, 2011 at 9:33 AM, davemac davemac...@gmail.com wrote: I'm no NFC guru, but from what I can tell of the docs and the samples, there's no way to do card

[android-developers] Re: Creating separate versions of apps for tablets

2011-03-05 Thread davemac
There's a difference between the XOOM's screen size (xlarge) and the screen density. The XOOM has a screen density of 160 dpi, which is considered mdpi. Higher density screens would be xhdpi. This page has a good explanation: http://developer.android.com/guide/practices/screens_support.html -

[android-developers] Re: Creating separate versions of apps for tablets

2011-03-04 Thread davemac
Use screen size and the supports-screens tag in your AndroidManifest.xml file. For tablets, you'd support xlarge. The Market will filter based on the device and your values. - dave On Mar 4, 1:21 am, Zsolt Vasvari zvasv...@gmail.com wrote: For now, you could set the targetSDK to 11 for the

[android-developers] Re: Can't communicate with NfcB tag

2011-03-03 Thread davemac
Are you making these calls from the main (a.k.a. UI) thread? That's not permitted due to the blocking nature of NFC interactions, and could be the cause of the exception. - dave On Mar 3, 1:30 pm, Paul Christensen p.ellischristen...@gmail.com wrote: I guess I should add that I am using API

[android-developers] Re: Can't communicate with NfcB tag

2011-03-03 Thread davemac
That was my one-and-only guess. Hopefully Nick Pelly will see this thread and reply. I imagine he's going to want more details about the tag you've got. Can you share more info about it? - dave On Mar 3, 10:59 pm, Paul Christensen p.ellischristen...@gmail.com wrote: good thought, but that's not

[android-developers] Re: NFC question: card emulation is not supported in the Android SDK yet, right?

2011-02-28 Thread davemac
, davemac davemac...@gmail.com wrote: I'm no NFC guru, but from what I can tell of the docs and the samples, there's no way to do card emulation on an Android device at this time, using the SDK. Is that correct? I see the published classes/methods for reading/writing tags, and for the Ndef

[android-developers] Re: Question about intent filters for NFC tags (tech)

2011-02-28 Thread davemac
Any update on the category question answer please? - dave On Feb 24, 5:36 pm, Nick Pelly npe...@google.com wrote: On Wed, Feb 23, 2011 at 7:26 PM, davemac davemac...@gmail.com wrote: I hate to seem like a nag on this topic, but I've got some more concerns about the documentation, and your

[android-developers] Looking for information on the Fragment dump() method (FragmentManager too)

2011-02-27 Thread davemac
Both of these classes have a dump() method which looks useful for debugging. I tried to use them in a sample application, but I'm not getting any output at all. My code looks like this from within my activity: public void dumpFragmentMgr() { FragmentManager fm =

[android-developers] Re: Fragment question: inter-fragment communication?

2011-02-27 Thread davemac
A little more formally, have your activity implement an interface such as OnMyFragmentListener, so that the activity must implement a method like onFragmentDidSomething(). When your fragment wants to send something to the activity, it can do the following:

[android-developers] NFC question: card emulation is not supported in the Android SDK yet, right?

2011-02-25 Thread davemac
I'm no NFC guru, but from what I can tell of the docs and the samples, there's no way to do card emulation on an Android device at this time, using the SDK. Is that correct? I see the published classes/methods for reading/writing tags, and for the Ndef push using P2P and the mysterious

[android-developers] Re: FileNotFoundException

2011-02-25 Thread davemac
Yup. I suspect it's in mkdirs() also. If there's a file called widgets on the SD card, your code won't work. - dave On Feb 25, 12:47 pm, TreKing treking...@gmail.com wrote: On Fri, Feb 25, 2011 at 11:17 AM, b_t bartata...@gmail.com wrote: What is wrong? Should I check something else? What

[android-developers] Re: GOOGLE TO BAN PAYPAL?!

2011-02-25 Thread davemac
Google announced in-app billing. See http://developer.android.com/guide/market/billing/index.html. - dave On Feb 25, 9:26 pm, rich friedel rich.frie...@gmail.com wrote: didn't they just do an update to the market which allows in-app billing? On Feb 25, 2011 9:16 PM, HeyYouThere

[android-developers] Re: Using Facebook API in Android

2011-02-25 Thread davemac
Here is code that does most of what you want: https://github.com/facebook/facebook-android-sdk/ To understand it more fully, check out this page: http://developers.facebook.com - dave On Feb 25, 5:38 pm, TreKing treking...@gmail.com wrote: On Fri, Feb 25, 2011 at 4:30 PM, mohammad arif

[android-developers] Re: Question about intent filters for NFC tags (tech)

2011-02-23 Thread davemac
tech, how do you specify the techlists on it? Or does this only work in foreground dispatch mode? Thanks for your help. - dave On Feb 23, 12:41 am, Nick Pelly npe...@google.com wrote: On Tue, Feb 22, 2011 at 6:50 PM, davemac davemac...@gmail.com wrote: I'm reading the documentation on NFC tags

[android-developers] Re: Question about intent filters for NFC tags (tech)

2011-02-23 Thread davemac
. But clearly the documentation needs to be fixed. Thanks - dave On Feb 23, 1:01 pm, Nick Pelly npe...@google.com wrote: On Wed, Feb 23, 2011 at 8:45 AM, davemac davemac...@gmail.com wrote: What you're saying doesn't jive with the documentation, which says the following (onhttp

[android-developers] Re: Question about intent filters for NFC tags (tech)

2011-02-23 Thread davemac
non-Ndef tag to send from FakeTagsActivity. And when I save my manifest.xml file either way, I get no errors. I appreciate any help that I can get. Thanks! - dave On Feb 23, 1:01 pm, Nick Pelly npe...@google.com wrote: On Wed, Feb 23, 2011 at 8:45 AM, davemac davemac...@gmail.com wrote: What

[android-developers] Re: Running multiple emulator instances on a single machine

2011-02-22 Thread davemac
See if you can spring for some more RAM. That will help a lot. Then make sure you kill anything you absolutely don't need running on the box at the same time. For example, you don't need Eclipse to start your emulator instances. You can simply run the android program from under the tools directory

[android-developers] Question about intent filters for NFC tags (tech)

2011-02-22 Thread davemac
I'm reading the documentation on NFC tags and intent filters to match on. For an action of ACTION_TECH_DISCOVERED, the intent filter must list the technologies to match on, using a filter file. What I wanted clarification on is whether or not I need to also specify for example NfcA when I'm

[android-developers] Re: Issue Determining the Location

2011-02-20 Thread davemac
There's no magic to the PASSIVE_PROVIDER. While you don't need to turn on a location provider to use passive, *somebody* must have turned something on, otherwise there won't be any updated locations. Passive let's you piggyback on someone else's location updates. Which means, if your

[android-developers] Re: Issue Determining the Location

2011-02-20 Thread davemac
I have gotten back a value.  Or is it dependent on whether one of his other apps ever used the GPS to update itself? d == davemac  davemac...@gmail.com writes:    d There's no magic to the PASSIVE_PROVIDER. While you don't need to    d turn on a location provider to use passive, *somebody

[android-developers] Re: Significant Fragment bug? onInflate() not called at the right time on a restart

2011-02-20 Thread davemac
of things to directly change the argument bundle.  If only Java had a concept of const. :p On Sat, Feb 19, 2011 at 1:34 PM, davemac davemac...@gmail.com wrote: I also noticed that while you can't call setArguments() after the fragment has been attached to an activity, you can get

[android-developers] Significant Fragment bug? onInflate() not called at the right time on a restart

2011-02-19 Thread davemac
I created a bug report for this a couple of days ago, but it doesn't seem to have received any attention: http://code.google.com/p/android/issues/detail?id=14796 To reproduce the problem, add the following callback override to the TitlesFragment class in FragmentLayout.java under the ApiDemos

[android-developers] Re: Significant Fragment bug? onInflate() not called at the right time on a restart

2011-02-19 Thread davemac
. On Sat, Feb 19, 2011 at 11:53 AM, davemac davemac...@gmail.com wrote: I created a bug report for this a couple of days ago, but it doesn't seem to have received any attention: http://code.google.com/p/android/issues/detail?id=14796 To reproduce the problem, add the following callback override

[android-developers] Re: Significant Fragment bug? onInflate() not called at the right time on a restart

2011-02-19 Thread davemac
at all because it's too late to do anything, or it's firing too late. Which tells me it's not just a documentation change. - dave On Feb 19, 4:00 pm, Dianne Hackborn hack...@android.com wrote: Thanks, I'll update the documentation. On Sat, Feb 19, 2011 at 12:46 PM, davemac davemac

[android-developers] Re: Significant Fragment bug? onInflate() not called at the right time on a restart

2011-02-19 Thread davemac
. And of course all of that would be bad. So is there a good reason why onInflate() does not get called prior to onAttach() on a restart? Also, could you please share the updated documentation with us sooner rather than later? - dave On Feb 19, 4:20 pm, davemac davemac...@gmail.com wrote

[android-developers] Re: Significant Fragment bug? onInflate() not called at the right time on a restart

2011-02-19 Thread davemac
, Feb 19, 2011 at 1:34 PM, davemac davemac...@gmail.com wrote: I also noticed that while you can't call setArguments() after the fragment has been attached to an activity, you can get the arguments bundle and add or modify its contents. This means in theory I could update the arguments bundle

[android-developers] Re: Fragment question: inter-fragment communication?

2011-02-18 Thread davemac
, with fragments you'll want to unlearn a lot of the painful things you got used to dealing with in embedded activities. :) On Thu, Feb 17, 2011 at 8:10 PM, davemac davemac...@gmail.com wrote: I'd love to hear opinions on the best way to communicate between fragments. If we consider

[android-developers] Re: Suggest some Android Projects

2011-02-18 Thread davemac
How about an app for day traders that can correctly pick good stocks to buy and sell to make a lot of money for the user? - dave On Feb 18, 3:45 pm, TreKing treking...@gmail.com wrote: On Thu, Feb 17, 2011 at 12:42 AM, Rashtrapathy rashtrapa...@gmail.comwrote: Request everyone to suggest

[android-developers] Fragment question: inter-fragment communication?

2011-02-17 Thread davemac
I'd love to hear opinions on the best way to communicate between fragments. If we consider that fragments are like sub-activities (a common metaphor), then we might think to use broadcast messages to tell one fragment about something that happened in another fragment. That seems a bit difficult

[android-developers] Fragment question on when to acquire data?

2011-02-15 Thread davemac
There are quite a few callbacks associated with a fragment. The sample programs I've seen so far use simple, local string and resource data in onActivityCreated(), which seems late to me. Would there be any problem with spinning off a thread, or AsyncTask, or equivalent, as early as onAttach(), or

[android-developers] Re: Fragment question on when to acquire data?

2011-02-15 Thread davemac
onActivityCreated() is late, the time until the main thread actuallly goes back to process the next message in the queue is way way way late, after everyone has gone through onResume(). On Tue, Feb 15, 2011 at 4:06 PM, davemac davemac...@gmail.com wrote: There are quite a few callbacks associated

[android-developers] Re: Fragment question on when to acquire data?

2011-02-15 Thread davemac
(). On Tue, Feb 15, 2011 at 4:06 PM, davemac davemac...@gmail.com wrote: There are quite a few callbacks associated with a fragment. The sample programs I've seen so far use simple, local string and resource data in onActivityCreated(), which seems late to me. Would there be any problem with spinning

[android-developers] Re: Fragment question on when to acquire data?

2011-02-15 Thread davemac
gets onActivityCreated(). - dave On Feb 15, 9:24 pm, davemac davemac...@gmail.com wrote: Also, did you mean the time between my fragment's onAttach() and onActivityCreated() is in the activity's onStart()? - dave On Feb 15, 8:48 pm, Dianne Hackborn hack...@android.com wrote: This really

[android-developers] Re: adb upload

2011-02-15 Thread davemac
With the new ADT, you don't even need to set debuggable in AndroidManifest.xml. When you do Run As- or Debug As- from Eclipse to either a device or to the emulator, you're going to get a debug version of your apk (unless you explicitly set debuggable to false). When you choose your project in

[android-developers] Re: Fragment question on the use of the arguments bundle

2011-02-14 Thread davemac
with arguments, you need to be sure to also explicitly write an empty constructor. On Sun, Feb 13, 2011 at 2:32 PM, davemac davemac...@gmail.com wrote: I think I understand the logic behind using Bundles to pass in and store values associated with a Fragment, but I wondered if someone could

[android-developers] Best practice for when to go get data in a Fragment lifecycle?

2011-02-14 Thread davemac
Given the lifecycle of a Fragment, when would it be best to go get data for it? The samples so far have relied on simple built-in String and resource data, and it's been accessed in onActivityCreated(), which seems late to me. If I have a fragment that needs to read from a database, from the disk,

[android-developers] Fragment question on the use of the arguments bundle

2011-02-13 Thread davemac
I think I understand the logic behind using Bundles to pass in and store values associated with a Fragment, but I wondered if someone could validate my understanding. I believe that it makes sense to use a Bundle to pass in initial values at the time of construction of a Fragment for a number of

[android-developers] Re: Android Application without a Main Activity?

2011-02-13 Thread davemac
Sure you can! There's nothing that says you must have an Activity in your application. Does your widget handle all user interaction though? Do you have any notifications that a user might click on and expect to see an activity UI? A user can always find your application in the Settings -

[android-developers] Re: NFC a viable sync mechanism?

2011-02-09 Thread davemac
As of today, Android 2.3.3 has a lot more support for NFC, including writing tags and some peer-to-peer communications. I haven't even scratched the surface yet so can't vouch for the new features, but definitely check it out. - dave On Jan 26, 2:05 am, andrew and...@mackenzie-serres.net wrote:

[android-developers] Re: NFC default app - thoughts?

2011-02-07 Thread davemac
For now, the NFC tag data is in an intent's extras. Therefore you can't setup any other filtering in the manifest to only see certain discovered tags. I believe the expectation is that you'll only have one app on your device for dealing with NFC tags. - dave On Feb 7, 4:09 pm, Mark Murphy

[android-developers] Re: How to test SIP Demo in emulator.

2011-02-07 Thread davemac
You can't test SIP in the emulator. SIP is not supported there. You'll need to find an Android 2.3 device or later and test it there. - dave On Jan 26, 9:45 pm, Seung Yong Lee celine22...@gmail.com wrote: Hi, This is jimmy. I'm going  to testSIPdemo in emulator, but I could not test it using

[android-developers] Is the SIP API complete? Seems the answer might be no.

2011-02-07 Thread davemac
I'm trying to understand the SIP API beyond making and receiving audio- only calls. For audio-only, everything appears to be in place for an app to make a call, or receive a call, so the user can talk and hear and all's well. The work is done with the SipAudioCall class. But for more

[android-developers] Re: Can't download Honeycom Preview

2011-01-31 Thread davemac
This is the third thread on this topic to appear in Android Developers since the preview package disappeared on Friday. So far there is no information on why it went away, or when it will reappear. - dave On Jan 31, 3:37 am, Chih-Wei cwhu...@linux.org.tw wrote: Downloading SDK Platform Android

[android-developers] LocationManager.requestSingleUpdate() crashes device

2011-01-30 Thread davemac
this myself. my guess is the same as yours ... the docs must be incorrect. On Dec 7, 9:02 pm, davemac davemac...@gmail.com wrote: This is a new method in Android 2.3's LocationManager. It says basically the same thing as what it says for requestLocationUpdates(), except that there's no way

[android-developers] Re: Honeycomb emulator on Linux

2011-01-29 Thread davemac
Which exact version of the JDK are you all running your emulator on? And are you using Sun's or the OpenJDK? - dave On Jan 29, 11:36 am, Mark Murphy mmur...@commonsware.com wrote: FWIW, I have no problem launching existing AVDs in Ubuntu 10.10 with SDK Tools 9. On Sat, Jan 29, 2011 at 10:46

[android-developers] Re: Did the Honeycomb platform package go away?

2011-01-29 Thread davemac
I was able to get a copy of the file from a friend of mine so I'm now good. The repository.xml file on Google has this for the sha1 checksum: sdk:archive os=any arch=any sdk:size99663071/sdk:size sdk:checksum type=sha1b11da2f078b7383b0c3357847ab6ede367973ce3/ sdk:checksum

[android-developers] Re: Dual mode (Honeycomb Gingerbread) is the same APK.

2011-01-28 Thread davemac
Maybe a hint or two at least? Will we really have the same activities for both phones and tablets? Or will it be easier to make those separate? - dave On Jan 28, 7:54 pm, Dianne Hackborn hack...@android.com wrote: I have some stuff I'd like to do for a solution for fragments, but nothing to

[android-developers] Did the Honeycomb platform package go away?

2011-01-28 Thread davemac
I'm trying to download Honeycomb preview but I get this from sdk_manager: Downloading SDK Platform Android Honeycomb Preview, revision 1 File not found: http://dl-ssl.google.com/android/repository/android-3.0_pre_r01-linux.zip I've tried with https also with the same result. Where is it now

[android-developers] Re: NFC a viable sync mechanism?

2011-01-25 Thread davemac
In theory, it could be. Android doesn't have the NFC API fleshed out enough to allow this yet. You might be able to get to it via Android NDK and native code. - dave On Jan 25, 7:17 pm, Zsolt Vasvari zvasv...@gmail.com wrote: Is NFC a viable synch mechanism for exchange bi-directional small

[android-developers] Re: NFC doubts. JSR 257 - 177

2011-01-22 Thread davemac
H. Dianne's link doesn't appear to work. Any help here? - dave On Jan 18, 9:12 pm, Dianne Hackborn hack...@android.com wrote: There are links at the bottom of the page to the full source.  This is also part of the platform sample code, so it is included with all of the other sample code

[android-developers] Re: SharedPreferences.Editor.apply() -- very confused

2011-01-18 Thread davemac
Yikes! Two thoughts here. One, that switch statement is a bad idea since the behavior in Honeycomb (and Ice Cream Sandwich, etc) will revert back to a commit(), unless you're incredibly diligent about updating your code in a timely fashion. The second and scarier thought is that many times we're

[android-developers] Documentation errors for LocationManager.requestSingleUpdate() ?

2010-12-07 Thread davemac
This is a new method in Android 2.3's LocationManager. It says basically the same thing as what it says for requestLocationUpdates(), except that there's no way to specify a minTime or minDistance. From the name I would guess that my listener is going to be called once and that's it, maybe as soon

[android-developers] Re: Extending Application class and broadcast receivers

2010-11-07 Thread davemac
I saw Dianne's post on Oct 31 regarding this topic. I'm also a co- author of an Android book that advocated the approach of extending the Application class. We're currently busy updating in preparation for Pro Android 3, and I can assure you I've already replaced that section with one explaining

[android-developers] Re: Can u help me to find the mistake? i can't run this program.

2010-10-31 Thread davemac
I'm going to guess that asking for the SEARCH_SERVICE and casting it to a SensorManager is not going to go well for you. You're probably getting a NoSuchMethodException, yes? - dave www.androidbook.com On Oct 29, 12:01 am, 菠菜冬 huabeiyipil...@gmail.com wrote: package com.android.CirclingCounter;

[android-developers] Re: How to debug an application that hangs after awhile

2010-10-29 Thread davemac
Try using DDMS and watch your application's threads and memory usage over time. Perhaps you've got a memory leak somewhere? You can also use 'telnet localhost port' command to connect up to the emulator and simulate events such as low memory. Perhaps your app is eventually restarting and running

[android-developers] Re: problems with cancelling of BackgroundAsyncTask in Activity

2010-10-23 Thread davemac
I'm guessing that your first background task was running the whole time, and when you restarted your application you got a new instance of the activity, and probably you created a new instance of the background task so now you have two tasks running. The old activity is not accessible to you

[android-developers] Re: Trouble recording audio

2010-10-06 Thread davemac
Can't tell from what you've written here. Are you sure that bufferSize is big enough? You might want to use the getMinBufferSize() method to be more sure. Can you show how you do the reading of the audio? Can you show how you write it out to the file? Are you reading a smaller sample buffer size

[android-developers] Re: Setting/Passing values

2010-09-30 Thread davemac
You should also check out this handy method: PreferenceManager.setDefaultValues(Context context, int resId, boolean readAgain) Assuming you've defined default values for preferences in your preferences.xml file, this method will use those to initialize your saved preferences file. Which means

[android-developers] AudioRecord Class Problem: Callback is never called (revisited/resolved)

2010-09-27 Thread davemac
I've been perplexed by the AudioRecord documentation on the OnRecordPositionUpdateListener interface but I think I got it figured out. All of the posts in this group asking why the callbacks are never called were assuming that the callbacks would tell you when to do a read. But what you need to be

[android-developers] Re: HttpClient routine works but w/o connection, it times out?

2010-09-18 Thread davemac
In addition to putting your http calls into a separate thread, you could also add HttpParams to your HttpGet object to set timeouts, both for the connection and for the operation. Something like the following: HttpParams params = new BasicHttpParams();

[android-developers] Re: AsyncTask and screen rotation

2010-09-12 Thread davemac
So we could use something as simple as the following? @Override public Object onRetainNonConfigurationInstance() { return myAsyncTask; } And in onCreate(): if( (myAsyncTask = (MyAsyncTask)getLastNonConfigurationInstance()) != null)

[android-developers] Re: So can we use Directions API or not in Android?

2010-08-24 Thread davemac
in that         case, I would be curious why noone would be exploiting these         APIs to make profit).         Best regards,         Filip Havlicek         2010/8/24 davemac davemac...@gmail.com         mailto:davemac...@gmail.com mailto:davemac...@gmail.com

[android-developers] Re: So can we use Directions API or not in Android?

2010-08-23 Thread davemac
.) 2010/8/22 davemac davemac...@gmail.com I would love to be able to use the Directions API in my Android app, but I'm confused by the information in the Directions API documentation:http://code.google.com/apis/maps/documentation/directions/ so the short form of my question is: can

[android-developers] So can we use Directions API or not in Android?

2010-08-22 Thread davemac
I would love to be able to use the Directions API in my Android app, but I'm confused by the information in the Directions API documentation: http://code.google.com/apis/maps/documentation/directions/ so the short form of my question is: can Android apps use the Google Directions API? It clearly

[android-developers] Re: Can anyone call TextToSpeech in your class, not in Activity?

2010-08-16 Thread davemac
The constructor for TextToSpeech is supposed to look like this: TextToSpeech(Context context, TextToSpeech.OnInitListener listener) So when you create it inside your new class, you need to pass it what it wants. - dave www.androidbook.com On Aug 16, 3:25 pm, Filip Havlicek

[android-developers] Re: library project returns wrong resource

2010-05-23 Thread davemac
Sounds like your bitmap is being scaled before it is returned to your code. Could you post some code so we can see what you're trying to do? Android might perform scaling to match screen density. - dave http://www.androidbook.com On May 23, 2:05 pm, Greg Donald gdon...@gmail.com wrote: I have a

[android-developers] Re: Android Market Place

2010-05-23 Thread davemac
I'm not quite sure what you're asking here, but I'm pretty sure the answer is no. Uploading an app to Android Market involves a specific set of information that it uses to make your app available to Android Market clients. Could you be more specific about what you're trying to do? - dave

[android-developers] Re: HTC EVO/Incredible multitouch only reporting max of 2 points?

2010-05-23 Thread davemac
Android supports more than 2, but can only work with more if the underlying platform (hardware plus drivers) gives it more than 2. Your test is probably perfectly valid and you're stuck with only 2. - dave http://www.androidbook.com On May 23, 1:27 am, Robert Green rbgrn@gmail.com wrote:

[android-developers] Re: onActivityResult does not always get triggered when using IMAGE_CAPTURE with startActivityForResult

2010-05-23 Thread davemac
Does the issue have anything to do with device orientation changes while taking a picture? That is, if you take a picture without rotating the device, does it work better than if you rotate to take a picture? - dave On May 20, 12:44 am, efe sey...@seymen.com wrote: Hi all, I am trying to

[android-developers] Re: Advice on buying android phone for development

2010-03-29 Thread davemac
I didn't know the iPhone supported all Android versions. Good to know ;-) - dave On Mar 29, 7:02 pm, Gabriel Simões gsim...@gmail.com wrote: Can´t any android device use any android version just like the iphone? On 29 mar, 17:52, Sean Hodges seanhodge...@googlemail.com wrote: On Mon, Mar

[android-developers] Re: webkit onGestureXXX

2010-03-19 Thread davemac
I'm not familiar with the iPhone capabilities, but Android comes with the ability to understand gestures. Check out GestureOverlayView: http://developer.android.com/reference/android/gesture/GestureOverlayView.html - dave www.androidbook.com On Mar 19, 12:38 pm, mike enervat...@gmail.com wrote:

[android-developers] Is there a way to see your Developer Composite Score?

2010-01-20 Thread davemac
The Terms of Service for Android Market say that Google can compute a Developer Composite Score based on history, etc. Maybe it doesn't exist but if it does, is there a way for me to see what my score is? - dave -- You received this message because you are subscribed to the Google Groups Android

[android-developers] Re: Cannot view saved image until reboot

2009-12-27 Thread davemac
After you have your new image file on the sdcard you need to use a MediaScannerConnection to make it known to the Gallery. The method is scanFile. It's best for your activity to implement the MediaScannerConnectionClient interface, and the two callbacks to coordinate the addition of your new image

[android-developers] Re: Controlling the current MediaPlayer

2009-12-27 Thread davemac
Alex, Can you be more specific on what you truly want to do? Are you trying to write an activity that offers a higher level of control over the playing of media on the device? Or are you concerned about a MediaPlayer already running on the device when your activity starts? If the latter, then I

[android-developers] How to view in Gallery a picture taken with Camera via an intent?

2009-11-30 Thread davemac
This ought to be simple but I can't figure it out. I want to use the Camera app to take a picture, then I want to view it in a picture viewer such as Gallery. Since the camera in the emulator doesn't work yet, I'm doing this on a Motorola Droid device. I do the following in my application

[android-developers] Re: SDK 2.0 Traceview in The Droid.

2009-11-23 Thread davemac
Yes. You need to add a uses-permission to your AndroidManifest.xml file for android.permission.WRITE_EXTERNAL_STORAGE. - dave On Nov 20, 9:39 pm, JHandal jhand...@gmail.com wrote:  HI I'm running the basic HelloActivity from the SDK 2. samples. When I try Trace view in the DDMS prespective

[android-developers] Has anyone got SEQUENCE_INVARIANT to work with a GestureLibrary?

2009-11-22 Thread davemac
I've been trying to figure out how to use a GestureOverlayView with my application, and wanted to see if SEQUENCE_INVARIANT would make a difference. That is, I do this: gestureLib.setSequenceType(GestureStore.SEQUENCE_INVARIANT); before trying to use gestureLib.recognize(). The short answer is

[android-developers] Re: Map Application works in 1.5 but not working in 2.0

2009-11-22 Thread davemac
When it says it will only install on devices with Maps, it means the Google Maps API, not the Google Maps application. I believe that's why it will still install on the emulator, but because Google isn't providing the Google Maps app with the Android 2.0 emulator, your attempt to reach Google Maps

[android-developers] getPressure and getSize in MotionEvent always return the same value?

2009-11-21 Thread davemac
This is for a touchscreen application. If I press a finger down and drag it around, I would expect that getPressure and getSize would give me a different value as I change how hard I press while dragging. However, both of these methods always return the initial value from the first MotionEvent

[android-developers] Re: WebView not loading Assets correctly... help?

2009-11-17 Thread davemac
Have you looked into using a base tag in your HTML? - dave On Nov 17, 6:27 pm, Mark Murphy mmur...@commonsware.com wrote: Jeremy Logan wrote: I actually just realized that mistake and tried it the way you suggested. No change. H...the only times I've used file:///android_asset has

  1   2   >