[android-developers] In-app-billing experience vs PayPal?
Hi, I've got a multiplayer game where users can play up to 5 games at a time for free. I'd like to offer the option to pay $N to play up to 10 games at a time. This seems likes a perfect use-case for paypal, but it sounds like the marketplace terms forbid this. The 30% cut that marketplace would take for this seems a little unfair because the additional load would be placed on my game servers, not on google. There also seem to be some disturbing unsolved bugs with the in-app billing system: http://code.google.com/p/marketbilling/issues/detail?id=14 So there are companies like Papaya and other music distributors that let you buy content through their apps, are they also sharing up the 30% via google's in-app billing? Just curious before I dive into anything, the in-app billing doesn't look very straightforward at a glance and time is limited as always.. 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] HttpURLConnection + keep alive timeout? (the way forward starting with gingerbread)
Hi, It looks like the android team will be investing more resources in support / improvement of the HttpURLConnection class, based on this dev post here: http://android-developers.blogspot.com/2011/09/androids-http-clients.html For Gingerbread and better, HttpURLConnection is the best choice New applications should use HttpURLConnection; it is where we will be spending our energy going forward. It looks like connection pooling is supported by HttpURLConnection, but seems to have a timeout of 5 seconds? (I can't find any documentation on this). Is there any way to increase the duration that connections are kept alive? I'm creating connections to https://example.com/echo?param=abc;. If the user initiates connections in intervals 5 seconds, I can see the https setup is avoided, hinting me that the connection is being reused. But if the connections are spaced out 5 seconds, I see the entire https setup done again, making me think the connections are not being reused. Is there a way for us to increase this timeout? 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] NullPointerException in WebView [onWindowFocusChanged WebView.java:4177]
Hi, I'm seeing a bug in webview, same as in this thread: https://groups.google.com/group/android-developers/browse_thread/thread/92d6f063682d2ca4/2c56e6e85c51e507 I've found that someone has posted a workaround, wondering if anyone has tried it?: http://www.zubha-labs.com/workaround-for-null-pointer-excpetion-in-webv http://stackoverflow.com/questions/6525005/npe-at-android-webkit-webview-onwindowfocuschanged Out of the crash reports I'm seeing in marketplace, 75% of them are coming from Droids, the rest from other, I'm hesitating to try the above workaround if it'll break other clients for which the problem doesn't seem to exist? 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] Get gallery app to scan sd card for new images?
Hi, If I create a folder on my sd card, and store images there (test.jpg etc), the built-in gallery app will see them whenever I restart the phone (nexus s, galaxy s). Is there a way to hint the gallery app to scan the sd card for media (a specific folder would be great). Otherwise I have to tell my users that they won't see photos I'm storing for them until they restart the phone. 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: Get gallery app to scan sd card for new images?
Perfect, thanks. On Jul 11, 3:59 pm, Mark Murphy mmur...@commonsware.com wrote: http://stackoverflow.com/questions/2870906/adding-pictures-to-the-gal... On Mon, Jul 11, 2011 at 3:55 PM, Mark Wyszomierski mar...@gmail.com wrote: Hi, If I create a folder on my sd card, and store images there (test.jpg etc), the built-in gallery app will see them whenever I restart the phone (nexus s, galaxy s). Is there a way to hint the gallery app to scan the sd card for media (a specific folder would be great). Otherwise I have to tell my users that they won't see photos I'm storing for them until they restart the phone. 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 -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.5 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] Can't get WebView timers to stop - leak
Hi, I have a WebView in my activity which loads some html pages which have timers. I can see the timers continue running after exiting the activity by logging WebViewClient.onLoadResource() statements. I have tried calling resumeTimers() + pauseTimers() in my onResume() + onPause() methods. Also tried putting an extra resumeTimers() call in onCreate() as suggested in this same bug: http://code.google.com/p/android/issues/detail?id=13991 The only way I can get the timers to stop is to load some dummy html into my webview before the activity finishes: protected void onPause() { super.onPause(); if (isFinishing()) { mWebView.loadData(html/html, text/html, utf-8); } } Anyone else experiencing this? 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] MyLocationOverlay on a collapsed MapView?
Hi, Are there any terms of service for using MyLocationOverlay along with MapView? I have a MapActivity where I am showing the user's most up to date location in a TextView, and the MapView is below that. The user has the option to hide the MapView if they don't care to see it, but I continue getting location updates from the MyLocationOverlay instance, which in turn updates the TextView. Is this scenario violating any terms of service? Wondering if we use MyLocationOverlay, does it always need to be visible to the user? 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: MyLocationOverlay on a collapsed MapView?
Correct, but the TOS for the maps api doesn't reference use of the MyLocationOverlay class. I'm not interpreting anything in the TOS against the use I described, was wondering if anyone had experience here, or if someone from the google team could comment, Thanks On Jun 21, 11:53 am, TreKing treking...@gmail.com wrote: On Tue, Jun 21, 2011 at 10:41 AM, Mark Wyszomierski mar...@gmail.comwrote: Are there any terms of service for using MyLocationOverlay along with MapView? 5 second Google search:http://code.google.com/android/maps-api-tos.pdf --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 of my apps no longer appears in searches, or under my apps public page?
@Tom, yeah my app started appearing again now, thanks for the heads up. I wonder if they could send out a planned maintenance email with a warning that there might be some quirks for a given period of time. On Jun 11, 3:20 am, Tom / HyperBees tomek.ml...@gmail.com wrote: Gents, I was told that Google was running some Market updates yesterday and they are aware of the situation. Games we published started to disappear from search on Friday afternoon GMT. On Jun 11, 7:58 am, b_t bartata...@gmail.com wrote: My apps disappeared too. :( What is going on? On Jun 11, 1:51šam, Kostya Vasilyev kmans...@gmail.com wrote: Mine stopped appearing in searches by name. Will try to make a dummy change as well. -- Kostya Vasilyev 11.06.2011 8:03 ÐÏÌØÚÏ×ÁÔÅÌØ Mark Wyszomierski mar...@gmail.com ÎÁÐÉÓÁÌ: Quick update - I thought maybe somehow my app got dropped from google's end, so I just modified a few characters of my app description and saved. Now it at least appears in direct searches in marketplace. Still doesn't show up its old search terms, or under my accounts page. Sigh. On Jun 10, 11:58 pm, Mark Wyszomierski mar...@gmail.com wrote: Hi, I have a few apps in the marketplace. One of them no longer appears in searches, and if I look under the other apps from this developer page for myself, it doesn't appear there either. I can see the app ok using its direct url, and it also appears ok in my marketplace control panel. There aren't any notes on it like that it was banned or something, it's a pretty generic application. Anyone else experiencing this? 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 -- 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] One of my apps no longer appears in searches, or under my apps public page?
Hi, I have a few apps in the marketplace. One of them no longer appears in searches, and if I look under the other apps from this developer page for myself, it doesn't appear there either. I can see the app ok using its direct url, and it also appears ok in my marketplace control panel. There aren't any notes on it like that it was banned or something, it's a pretty generic application. Anyone else experiencing this? 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: Add menu items to other apps?
I doubt it's possible it'd be a huge security issue. On Jun 10, 11:11 pm, treyb tr...@ufl.edu wrote: I am trying to make an app that will run like a service and add a menu item (Print Button) to other apps like the web browser and such. How can I accomplish this if at all possible? -- 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 of my apps no longer appears in searches, or under my apps public page?
Quick update - I thought maybe somehow my app got dropped from google's end, so I just modified a few characters of my app description and saved. Now it at least appears in direct searches in marketplace. Still doesn't show up its old search terms, or under my accounts page. Sigh. On Jun 10, 11:58 pm, Mark Wyszomierski mar...@gmail.com wrote: Hi, I have a few apps in the marketplace. One of them no longer appears in searches, and if I look under the other apps from this developer page for myself, it doesn't appear there either. I can see the app ok using its direct url, and it also appears ok in my marketplace control panel. There aren't any notes on it like that it was banned or something, it's a pretty generic application. Anyone else experiencing this? 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] NFC tags with write protection?
Hi, I've got some NFC tags and have written some data into them using the NXP Tag Writer app available from marketplace. After writing some data in the tag, I'd like to remove write-access to it so people can't overwrite the tag data. Using the Tag Writer app, I get a message stating that write protection is not available for the tags I have. Does anyone know of any tags I can order which are writeable and have write protection available too? 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: '-1' error during HTTPS communication.
I see the -1 behavior when using HttpURLConnection with https. It doesn't happen every other time, but near enough. I couldn't find any answers to this (works as expected with http). I just put a try / catch block and give three tries to the connection: for (int i = 0; i 3; i++) { try { // try to make the connection, quit on success.. break; } catch (Exception ex) { // try again. } } I have not seen this behavior with HttpClient. Mark On Apr 1, 6:06 am, ABhi abhishek.gonda...@gmail.com wrote: Hi All, Below is my problem scenario. - My Server is on running on https. - Doing connection with ‘HttpURLConnection’ api already tried ‘HttpClient’ as well earlier but both are showing same issue. - Server certificate is ‘Verisign Class 3’ certificate. - Every alternate request sent to server, receives ‘-1’ in http response code. For e.g. If my first request is successful (200 code) second request would get (-1) code, then again successful then again 4th request gets -1 in response. I’m not sure why this -1 code is returned there’s not description on HTTP standard site as well. Any idea how can i get rid off this '-1' response i receive. In which scenario server returns this code? I'm posting my sample code below. -- HttpURLConnection connection; SSLContext sc = SSLContext.getInstance(TLS); sc.init(null, new TrustManager[] { new TrustManager() }, new SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); HttpsURLConnection.setDefaultHostnameVerifier(new MyHostnameVerifier()); connection = (HttpsURLConnection) httpUrl.openConnection(); connection.setRequestMethod(POST); connection.setRequestProperty(Content-Length, String .valueOf(requestBinary.length)); connection.setRequestProperty(Content-Type, octet/x-application-csam); connection.setDoInput(true); connection.setDoOutput(true); connection.setConnectTimeout(3); connection.connect(); connection.getOutputStream().write(requestBinary); int responseCode = connection.getResponseCode(); -- 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: Android renders RGB values wrong.
I've seen render issues like this. I think one example was putting a png with a flat color next to a view with its background color specified with the same hex value. They won't match. It makes it really difficult to make portions of your layout blend together. Example: ImageView android:src=@drawable/flat_grey_ffebebeb_png / LinearLayout android:background=ffebebeb / I'm sure the png I created has the same hex value as the manually specified background value. Not sure why they don't match when you run, but, that's what it is. Mark On Apr 18, 11:48 am, Andrew Huang proelited...@gmail.com wrote: Specify a RGB, i.e, color name=test_color#ff292728/color. Use the a Color Meter tool on Windows or Mac to sample the color in the Layout Preview screen. You'll see that it renders the correct value of 292728. Sampling the same color in the emulator would return a different value, #282329. This is causing us some serious problems with our graphics (i.e. images are not correctly blending with the background), so we would like to understand what's going on. My searches have turned up nothing so far. If anyone has a deeper understanding of how colors are render, we would greatly appreciate the 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: Android renders RGB values wrong.
Not all devices use 24-bit color buffers. Some are 16-bit Good point. I saw this on the N1, nexus S for sure, can't remember where else I saw it. On Apr 26, 5:08 pm, Kostya Vasilyev kmans...@gmail.com wrote: PNG is lossless, it's basically LZW or something similar applied on a per-block basis, IIRC. JPG is the lossy one. The build tools do perform some image optimizations, but, as far as I know, they don't change color values. 27.04.2011 1:04 пользователь lbendlin l...@bendlin.us написал: png is lossy, right? What if you use a lossless format? -- 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 -- 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] # downloads seems to get stuck in marketplace admin console?
Hi, When you log into the admin console for android marketplace, we see two numbers: N total N active installs (M%) These numbers appear to get stuck for me quite regularly. The new hyperlink named stats shows me active installs per day which seems to really be updated daily. I am also tracking installs as a side effect of the nature of my multiplayer game, so I'm again sure downloads are going up. I'm just wondering which numbers to trust here, or why the values seem to get stuck. Are they only updated once weekly or something like that? 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: # downloads seems to get stuck in marketplace admin console?
Ok thanks for confirming Tre, I saw this happen about a year ago but was hoping it had been resolved by now, Thanks On Apr 25, 4:49 pm, TreKing treking...@gmail.com wrote: On Mon, Apr 25, 2011 at 3:21 PM, Mark Wyszomierski mar...@gmail.com wrote: I'm just wondering which numbers to trust here, None of 'em. or why the values seem to get stuck. Because the Android Market console is in a perpetual state of broken. Are they only updated once weekly or something like that? The only people that know the answer to that are neither on this list nor would answer you if they were. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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] TabWidget - drop shadow gone in android 2.3?
Hi, The TabWidget widget used to have a drop shadow below the tabs. This seems to be gone in android 2.3. Is that right? 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] NFC default app - thoughts?
Hi, If I declare my application to be able to read NFC tags using the following: activity android:name=.activities.ActivityFoo intent-filter action android:name=android.nfc.action.TAG_DISCOVERED/ /intent-filter /activity and the user chooses my app as the default for further reads, we're essentially wiping out the chance for any other app in the system to handle tag reading? Just wondering how we'll balance this. My tags actually point to specific urls, like: foo.com/a foo.com/b So what would be more ideal is to let the OS give the user a chance to set a default for a tag read action + a specific url domain pattern for example. That seems more fine-grained and appropriate here? Just wondering what others think on this, 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] Url matching in manifest matching too much?
Hi, I have an activity for which I'd like to intercept some urls. I have the following in my manifest: activity intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:scheme=http android:host=example.com android:path=/some/path / /intent-filter /activity However, it seems like any url I click is getting caught by the above pattern: www.example.com // matched www.example.com/foo // matched Shouldn't the path attribute in my definition above be knocking those matches above out? 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
Re: [android-developers] Re: Google analytics crash
I did the same, wrap all analytics calls in a try/catch block, Mark On Mon, Jan 3, 2011 at 3:39 AM, blindfold seeingwithso...@gmail.com wrote: Well, after another user apparently had 6 crashes in 2 minutes from GoogleAnalyticsTracker.trackEvent() right when launching my app, I've updated my app to wrap all Google Analytics calls in try-catch blocks to quench the symptoms. Even though the crash reports were rare, this seems to be the only/simplest way for me to avoid an occasional bad user experience due to use of Google Analytics. Regards java.lang.RuntimeException: Unable to start activity ComponentInfo{vOICe.vOICe/vOICe.vOICe.The_vOICe}: java.lang.IllegalStateException: no transaction pending at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2663) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2679) at android.app.ActivityThread.access$2300(ActivityThread.java: 125) at android.app.ActivityThread$H.handleMessage(ActivityThread.java: 2033) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4627) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:878) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: no transaction pending at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java: 555) at com.google.android.apps.analytics.PersistentEventStore.putEvent(Unknown Source) at com.google.android.apps.analytics.GoogleAnalyticsTracker.createEvent(Unknown Source) at com.google.android.apps.analytics.GoogleAnalyticsTracker.trackEvent(Unknown Source) at vOICe.vOICe.The_vOICe.a(Unknown Source) at vOICe.vOICe.The_vOICe.onCreate(Unknown Source) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2627) ... 11 more FINGERPRINT {verizon/thunderc/thunderc/thunderc:2.2/FRF91/eng.lge. 20101101.102025:user/release-keys} On Dec 31 2010, 3:55 pm, blindfold seeingwithso...@gmail.com wrote: Hmm, I have only one global tracker object that I create in the onCreate() of my main activity, and with a regular dispatch interval through the format tracker.start(UA-12345-0, nseconds, this), so I'd say that it all works from one alive thread. However, in one pair of crash logs the first GoogleAnalyticsTracker.trackEvent() crash occurs after my app had been running for some time, while the second GoogleAnalyticsTracker.trackEvent() crash occurs immediately at app startup only 3 minutes later, for the same device FINGERPRINT, suggesting that indeed some sort of lock had lived on even across runs to cause a second crash because the second run would not be owning the lingering lock. This was for a Samsung GT-I5800 running Android 2.1- update1. On Dec 31, 3:21 pm, H m...@howardb.com wrote: Looking in the analytics source after you've called trackEvent(), I suspect that error is coming out when it is using a database transaction to insert the event into the database. Once inserted, it calls endTransaction as well as setTransactionSuccessful. Both of these do this check: if (!mLock.isHeldByCurrentThread()) { throw new IllegalStateException(no transaction pending); } So it could be worth checking to see if you are tracking the event from a thread that has ended, or calling dispatch from a different thread...? HTH. -- 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 -- 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] Google analytics crash
Hi, I'm using google analytics in my app. I am getting a good number of force closes from users, finally got a stacktrace: Caused by: android.database.sqlite.SQLiteException: file is encrypted or is not a database at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method) at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java: 1864) at android.database.sqlite.SQLiteDatabase.init(SQLiteDatabase.java: 1814) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java: 808) at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java: 168) at com.google.android.apps.analytics.PersistentEventStore.getNumStoredEvents(PersistentEventStore.java: 160) at com.google.android.apps.analytics.PersistentEventStore.startNewVisit(PersistentEventStore.java: 177) at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(GoogleAnalyticsTracker.java: 108) at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(GoogleAnalyticsTracker.java: 99) at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(GoogleAnalyticsTracker.java: 83) at com.google.android.apps.analytics.GoogleAnalyticsTracker.start(GoogleAnalyticsTracker.java: 94) at com.me.myapp.MyActivity.onCreate(MyActivity.java:30) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2459) anyone else getting this? The call that causes it: private GoogleAnalyticsTracker tracker; tracker = GoogleAnalyticsTracker.getInstance(); tracker.start(mykey, context); - causes the exception. This is working fine for most users. I'm going to try catching the exception, hopefully that will work. 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: ClassNotFoundException crash reports from Market
Anyone word on this from google? I am distributing a pretty popular app and this error has popped up a few hundred times now in the marketplace crash report. I can't really do anything for these users except ask them to run something like Log Collector but it's a slim chance they'll do that (no takers yet). Looks like something related to google maps missing or some such thing?: java.lang.RuntimeException: Unable to instantiate application com.me.test.ActivityMain: java.lang.ClassNotFoundException: com.me.test.ActivityMain in loader dalvik.system.PathClassLoader[/ system/framework/com.google.android.maps.jar:/data/app/ com.me.test-1.apk] Caused by: java.lang.ClassNotFoundException: com.me.test.ActivityMain in loader dalvik.system.PathClassLoader[/system/framework/ com.google.android.maps.jar:/data/app/com.me.test-1.apk] Thanks On Nov 27, 10:10 am, Emanuel Moecklin 1gravity...@gmail.com wrote: Hi Moss The com.package.app is just an obfuscated package name (much like your com.package.app). In reality I'm using a unique name or that's what I hope I do ;-). Thanks for your post anyway. I really appreciate your support! Cheers Emanuel On Nov 24, 2:01 pm, Moss b.thax@gmail.com wrote: Could it be that the class loader is failing to find the right package? I just saw that you are using 'com.company.app' as your package name. Googling a bit I found that there are many apps that use the same schema. Normally I use my domain to identify my packages in a unique way like 'com.myweb.myapp'. I just tried to reproduce your error and creating 2 apps that use the same base package name I just get the error when launching them. I think that the class loader will pickup the first listed package and then try to load the class (which is not there :P): - com.package.app.ActivityA - com.package.app.ActivityB If I load com.package.app.ActivityB I'm getting the same error. Hope this can help you a bit. Cheers, Moss -- 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] Google analytics - dispatch frequency in android app?
Hi, I was looking at using google analytics for android. We can use the basic template below to record page views: public class MyActivity extends Activity { private GoogleAnalyticsTracker tracker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tracker = GoogleAnalyticsTracker.getInstance(); tracker.trackPageView(/test/ + getClass().getSimpleName()); } @Override protected void onDestroy() { super.onDestroy(); tracker.dispatch(); tracker.stop(); } } I wonder if anyone else is doing this, and if it's a significant battery drain? Ideally I wouldn't have to dispatch() on every onDestroy(), I'd rather move the dispatch() call to be called once at each app startup. But I'm not sure if the tracker persists all this data for you between application runs. The docs don't say much about it: http://code.google.com/mobile/analytics/docs/android/ So, in other words, will this work?: public class MyApp extends Application { @Override public void onCreate() { // If tracker in fact does persist all my tracks between app sessions, then push them // all up only once every time the app starts? GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance(); tracker.dispatch(); } } 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] Multiple clickable elements within a listview row? Good or bad idea?
Hi, I've got a pretty standard list control, it's got about 4 lines of text. Some of the text in each row might start a new activity when clicked, like: Row 1 John Doe [clickable, starts activity] 1234 Main Street [clickable, starts activity] Last Read: The Great Gatsby [clickable, starts activity] I haven't tried making multiple focusable items within a listview row for about a year now, but I think it caused issues when using the scroll wheel on the device of some sort. Is this a good pattern to use, or is there some other mechanism we can go with? Alternates are displaying a dialog when a row is clicked with buttons for each clickable element, a long-click to activate an options dialog, etc. I see that the twitter app has the multiple clickable elements per row pattern implemented, so maybe it's ok to go with? 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
Re: [android-developers] Market - download unsuccessful
Yes this continues to be a problem, seeing a good number of updates hanging in marketplace as reported by users. The app in question is a free app, nothing has changed in signing procedures etc. Wonder if there is any official word from google on what's going on? Thanks On Thu, Oct 28, 2010 at 7:03 PM, TreKing treking...@gmail.com wrote: On Thu, Oct 28, 2010 at 4:38 PM, john brown johnbrowngreybe...@gmail.comwrote: Does Market work perfectly everytime? Absolutely not. Does it have good times and bad times? Yes. Mostly bad :-) If you think it may be my app that is the problem, what / where should I look for as the problem? It's not your apphttp://market.android.com/support/bin/search.py?ctx=en%3Asearchboxquery=download+unsuccessful . - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 at http://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] Different hint strings for searchable activities?
Hi, I am supporting search in my app, I'd like to display a unique hint in the search box depending on what activity is being viewed. To that end, I have a two different searchable.xml files in my xml folder: searchable.xml searchable_activity_foo.xml When I reference searchable.xml, everything works as expected. The second searchable xml file has the same contents as the first, but this does not work: activity android:name=.Foo intent-filter action android:name=android.intent.action.SEARCH / /intent-filter meta-data android:name=android.app.searchable android:resource=@xml/searchable_activity_foo/ /activity Pressing the search key does not display the search box. If I just reference the first searchable instead, it works fine: meta-data android:name=android.app.searchable android:resource=@xml/searchable/ Again, both have the same content. It looks like there is a dependency on the name searchable.xml within android? If we're not allowed to have searchables named anything but searchable.xml, how do we specify different hint strings for different activities? For example: ActivityFoo = Search for apples! ActivityGrok = Search for oranges! 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: Different hint strings for searchable activities?
Nevermind, the different xml files are ok. My second xml file had a raw string in it which does not work (everything must use string references to strings.xml). On Oct 29, 1:56 pm, Mark Wyszomierski mar...@gmail.com wrote: Hi, I am supporting search in my app, I'd like to display a unique hint in the search box depending on what activity is being viewed. To that end, I have a two different searchable.xml files in my xml folder: searchable.xml searchable_activity_foo.xml When I reference searchable.xml, everything works as expected. The second searchable xml file has the same contents as the first, but this does not work: activity android:name=.Foo intent-filter action android:name=android.intent.action.SEARCH / /intent-filter meta-data android:name=android.app.searchable android:resource=@xml/searchable_activity_foo/ /activity Pressing the search key does not display the search box. If I just reference the first searchable instead, it works fine: meta-data android:name=android.app.searchable android:resource=@xml/searchable/ Again, both have the same content. It looks like there is a dependency on the name searchable.xml within android? If we're not allowed to have searchables named anything but searchable.xml, how do we specify different hint strings for different activities? For example: ActivityFoo = Search for apples! ActivityGrok = Search for oranges! 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] Tab Activity - custom titlebar limitations when using child activities
Hi, I have a TabActivity. Each tab hosts its own activity. I wanted to use a custom titlebar. I don't believe it's possible to access the custom titlebar from the child activities: // main tab activity public class MainTabActivity extends TabActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.my_content); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_header); } } I cannot move custom titlebar creation into the child activities, moving the above 3 lines into a child activity will throw an AndroidRuntimeException: You cannot combine custom titles with other title features I can only think of two possible solutions: 1) Replace tab activities with tab views - too late to do that now. 2) Create the custom header bar in the main tab activity as above. Let children activities broadcast a message that the main tab activity can catch when they want some part of the custom titlebar to change (like starting a progress bar etc). Any other possible solutions here? 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: Market - download unsuccessful
I've been seeing a lot of errors with downloads from marketplace recently, don't have any more detailed info than that. I've had to tell users to delete the app, then install fresh. If the user is just trying to update the app, the download seems to get stuck - never starts, just sits there saying downloading. Although deleting the app and installing fresh seems to be a workaround, it's inconvenient because it wipes out local data you may have stored for the user. On Oct 28, 5:38 pm, john brown johnbrowngreybe...@gmail.com wrote: Hello, I have published my app on Android Market. I have successfully downloaded and installed the app from Market on my Moto Droid 10 days ago. My beta tester #1 successfully downloaded and installed the app from Market on his Samsung Galaxy 8 days ago. My beta tester #2 gets download unsuccessful when she tries to dowload app from Market on her Motorola Droid X at 2010-10-28 4pm Central Std time USA (10pm GMT). She tried several times over a 30 minute period. When I uninstalled and tried to download my app during this same time period, it took longer than I expected, then finished and said Google Maps had successfully updated. No mention that my app did or did not install. My app is not installed on my phone now. Developer's Console shows no problem, 20 downloads, 4 active, no errors, no comments. (This app is industry specific and not workable without subscription to a website, etc.) Does Market work perfectly everytime? Does it have good times and bad times? If you think it may be my app that is the problem, what / where should I look for as the problem? Thanks, John Brown -- 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] TextView:autoLink=all + textAppearance bug?
Hi, I have a TextView. I am setting its textAppearance attribute, as well as autoLink=all: TextView android:layout_width=wrap_content android:layout_height=wrap_content android:autoLink=all android:textAppearance=@style/myStyle / With this configuration, items do get linkified, but the text for them is invisible. For example, the input: Hello, welcome to http://www.google.com!; will linkify the url correctly, but it will be invisible, so it will look like this when running: Hello, welcome to ! the link is still clickable and focusable though. If I remove the android:textAppearance line from my TextView declaration, then the link displays as usual. My style is simply: style name=myStyle item name=android:textSize16dip/item /style Any idea if this is a known bug, or if I'm doing something wrong here? If I just directly specify the textSize attribute on the TextView itself, it works fine, so maybe there is a bug with the linkify stuff when textAppearance is supplied. 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] Marketplace updates - notified if apk not installed through marketplace?
Hi, I created a signed apk. I uploaded it to marketplace as usual. I also installed a copy of it on a device directly, perhaps as an email attachment. If I upload an updated version of the app to the marketplace, will the device be notified that a new version of the app exists on marketplace? Or does that update-alert system depend on the app being originally installed through marketplace? 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] PreferenceActivity - set text color of preference category?
Hi, I have a PreferenceActivity. Is there a way to change the color of each section title?: PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/android; PreferenceCategory android:title=some title android:textColor=#FF // -- CheckBoxPreference android:key=... textColor won't work here, just an example. Is there some way to set this? 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] Dropping support for 1.5, separate build for those users on marketplace?
Hi, Is there a way to leave a version of an app on the marketplace (which is 1.5 compatible) and then put up a new version which is 1.6 and above compatible? The idea being that any 1.5 users going to marketplace can only download the 1.5 version, everyone else sees the 1.6+ version? I'm running into frequent view inflation issues on 1.5, it's like trying to develop for ie6. I have a version of the app which works great on 1.6+, limps along on 1.5. I'd like to just cut support for 1.5 here, and move on with 1.6+ since I'm spending too much time trying to make sure the views don't blow up on 1.5. Any way to do this? 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
Re: [android-developers] Dropping support for 1.5, separate build for those users on marketplace?
Right now, I'll generate two apks: Foo.apk Foo-1.5-final.apk They'll both have the same package names. Should I just change the 'versionName' in the manifest: // Foo.apk manifest android:versionName=Foo / // Foo-1.5.apk manifest android:versionName=Foo-1.5-final / then upload Foo.apk as usual (os targets updated of course), and Foo-1.5-final.apk should be uploaded as a completely separate application to marketplace, right? Then I basically have to tell 1.5 users that they should search for Foo-1.5-final if they want to use my app, they won't see Foo.apk at all. Is that right? Thanks On Fri, Sep 24, 2010 at 12:56 PM, TreKing treking...@gmail.com wrote: On Fri, Sep 24, 2010 at 11:32 AM, Mark Wyszomierski mar...@gmail.comwrote: Any way to do this? Set the 1.5 version to max and target SDK = 3 and the 1.6+ version to maxSDK = 8 (or whatever) and target to whatever you prefer, then update to Market. It should automatically filter your apps based on the platform the user is running, so only 1.5 users will see the 1.5 version and everyone else will see the 1.6 version. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 at http://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
Re: [android-developers] Re: Dropping support for 1.5, separate build for those users on marketplace?
Market won't let you upload two different apps with the same package name. Ah ok that's what I was thinking. Ok thanks for all the info, Mark On Fri, Sep 24, 2010 at 1:37 PM, Pent tas...@dinglisch.net wrote: They'll both have the same package names. Should I just change the 'versionName' in the manifest: Market won't let you upload two different apps with the same package name. Wouldn't for me, anyway. I have a separate cupcake build, but the package name has 'cupcake' appended. I set: Cupcake: minsdk 3, maxsdk 3 Other: minsdk 4 Pent -- 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 at http://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: Setting layout attributes based on android OS version?
Using a relative layout did help in this case - after some more testing, I found that TextView is still causing problems when maxLines=1 / singleLine=true. Taking the same relative layout, I can toggle those on and off, and cause a stackoverflowexception when they're on. This is only on 1.5, later os versions work great. Is there a way to specify a 1.5 layout folder though, similar to the drawable resources, or landscape folders? Something like: /layout mylayout.xml /layout-v3 mylayout.xml if running on 1.5, then the second layout would be used, if not, then the layout in the general /layout folder would be used?: Thanks On Sep 14, 3:21 pm, Kostya Vasilyev kmans...@gmail.com wrote: I wonder what would happen of you used RelativeLayout for the entire list item. -- Kostya Vasilyev --http://kmansoft.wordpress.com 14.09.2010 23:04 пользователь Mark Wyszomierski mar...@gmail.com написал: A bit of additional information found through more testing - if I restrict each of the textviews to be at most one line with the following: android:maxLines=1 android:singleLine=true then it works fine (even with the background drawable set). If I let any one of the text views go more than one line in height, the exception will be thrown. It is thrown as soon as I start scrolling (for example, even if I scroll very slowly, by one pixel). My list adapter isn't getting called to fetch another view as all are on screen at this point, it looks like some drawing state which happens when the list is being animated maybe? I'm not sure what other combinations I can try here in attributes on the text views, I was hoping that setting: android:ellipsize=none android:singleLine=false would get around whatever state it being hit, but no luck, Thanks On Sep 14, 11:29 am, Mark Wyszomierski mar...@gmail.com wrote: Cool I'll check out those facil... -- 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: Activity onResumed not getting called
Yeah I think by default if the app is not resumed for some period of time, android will restart the app instead of resuming it: http://developer.android.com/guide/topics/manifest/activity-element.html look at: android:alwaysRetainTaskState On Sep 23, 11:01 am, Albert albert8...@googlemail.com wrote: Hi, I'm having a very odd issue. I launch my app, use it then press the Home key and the app pauses and goes to the background. I can also resume it by launch it again, so far so good but if I leave it sitting on the background for a couple of hours and try to launch it, it calls onCreate() (on the paused activity) instead of just resuming, therefore loosing the previous state, it behaves as that screen is the entry point of the app. Has anyone seen a similar issue. Does someone know if this is a normal behaviour?? What I am missing here? Thanks, Alberto -- 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] ListView elements with background drawable go transparent on menu display?
Hi, I have a ListView, my rows each have a background drawable set. One strange quirk is that if I have a row selected (it is orange now), then hit the context menu, the orange focus color is lost, the row background is made transparent. When I dismiss the context menu, orange focus is returned to that element. This is what my setup looks like: ListView LinearLayout android:background=@drawable/some_simple_png / /ListView The above is not really defined like that in the xml layout file, it's just an example. I'm not sure if there is a fix for this. 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] When to add child views to a compound control?
Hi, I'm trying to make a compound control which looks like the following: LinearLayout ImageView / ImageView / ... /LinearLayout I want to fill a horizontal linear layout with as many image views as possible - but only a single row of them. I'm not sure where to add the image views to the layout at runtime, I am getting inconsistent results, for example: class Foo extends LinearLayout { void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, r, t, b); addAsManyImageViewsAsCanFit(r-l); } void addAsManyImageViewsAsCanFit(int width) { while (we can fit more) { ImageView iv = new ImageView(getContext()); iv.setLayoutParams(...); addView(iv); } } } I'm sure image views are getting added as child views, but they don't always take up space in the layout somehow (I'm giving them a fixed width and height for now). Where should I be adding the image views to the layout? onLayout? onSizeChanged? After adding each one, do I need to call requestLayout() or some other method on the parent? 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
Re: [android-developers] Same color specified in xml file and png appear differently?
I'm not quite sure what's going on - if I specify the color in my layout xml like so with alpha = FF: #ffebebeb then at least in the layout editor it now matches the color of my png (created in photoshop, with the same #ebebeb specification). When I run the app though, the emulator is showing it as a different type of grey. Did I miss what you meant by alpha channel difference, Mark? Thanks On Thu, Sep 16, 2010 at 9:59 AM, Mark Murphy mmur...@commonsware.comwrote: Might be an alpha channel difference. On Thu, Sep 16, 2010 at 9:51 AM, Mark Wyszomierski mar...@gmail.com wrote: Hi, I have a 9 png which is used as the background of a view, the stretchable region has a color of: #ebebeb I have a view next to it, and I've set its background color like so: LinearLayout android:background=#ebebeb when the two views are beside one another, you can clearly tell that the colors are not the same, they're different shades of grey. I'm seeing this on the emulators, haven't had a chance to try it on a device. Is this expected, or is there something I'm doing wrong in the color declaration? 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy -- 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 at http://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
Re: [android-developers] Same color specified in xml file and png appear differently?
Yeah I guess that's why I'm confused, the alpha of my png is 100%. So when I set the background color in the xml file to explicitly have alpha = ff, then the layout editor shows the two colors matching. It's just that when I run the app, the emulator (and n1 at least) show the background color (not the png) as the different grey, same as when I was previously *not* setting the alpha = ff. To sum it up: before: background=#ebebeb drawable in photoshop (100% alpha, ebebeb) layout editor and emulator show background as a purplish-grey. now background=#ffebebeb drawable (unchanged from before) layout editor shows background now matching my drawable, but at runtime it looks like the purplish grey from before. I'm not modifying the color at runtime (which could explain the difference), I'll make a separate test app to try and demo it, Thanks On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy mmur...@commonsware.comwrote: On Sat, Sep 18, 2010 at 11:17 AM, Mark Wyszomierski mar...@gmail.com wrote: I'm not quite sure what's going on - if I specify the color in my layout xml like so with alpha = FF: #ffebebeb then at least in the layout editor it now matches the color of my png (created in photoshop, with the same #ebebeb specification). When I run the app though, the emulator is showing it as a different type of grey. Did I miss what you meant by alpha channel difference, Mark? Well, you are halfway there. For starters, you need the alpha value of your background color to be the same as the alpha value of your PNG file. You know what the alpha value of your background color is, because you are setting it. Now, you need to determine the alpha value that Photoshop used with your PNG file. Also, if you choose a non-opaque (i.e., less than FF) alpha, things get more complicated, as you have to take into account the stuff the alpha channel is blending from behind the respective widgets. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://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
Re: [android-developers] Same color specified in xml file and png appear differently?
Hi Kostya, I'll probably end up doing that, I was just curious as to what is going on with this since everything seems to look ok - I'll make that test app and post back if I find anything, Thanks 2010/9/18 Kostya Vasilyev kmans...@gmail.com Perhaps you can use a small PNG drawable for the view where you currently specify a color constant? -- Kostya Vasilyev -- http://kmansoft.wordpress.com 18.09.2010 19:35 пользователь Mark Wyszomierski mar...@gmail.com написал: Yeah I guess that's why I'm confused, the alpha of my png is 100%. So when I set the background color in the xml file to explicitly have alpha = ff, then the layout editor shows the two colors matching. It's just that when I run the app, the emulator (and n1 at least) show the background color (not the png) as the different grey, same as when I was previously *not* setting the alpha = ff. To sum it up: before: background=#ebebeb drawable in photoshop (100% alpha, ebebeb) layout editor and emulator show background as a purplish-grey. now background=#ffebebeb drawable (unchanged from before) layout editor shows background now matching my drawable, but at runtime it looks like the purplish grey from before. I'm not modifying the color at runtime (which could explain the difference), I'll make a separate test app to try and demo it, Thanks On Sat, Sep 18, 2010 at 11:21 AM, Mark Murphy mmur...@commonsware.com wrote: On Sat, Sep 18,... -- You received this message because you are subscribed to the Google Groups Android Developers g... -- 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 at http://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] StateListDrawable and activity-menu-shown state?
Hi, I have a linear layout that is focusable, I'd like it to use the same background drawable as found in listview items: StateListDrawable sld = (StateListDrawable)context.getResources().getDrawable( android.R.drawable.list_selector_background); linearLayout..setBackgroundDrawable(sld); linearLayout.setFocusable(true); The default state of this selector is to be transparent, but I want a specific background drawable used in an unselected state. It would be ideal if we could just override this one state, and leave everything else the same: sld.addState(new int[] { -android.R.attr.state_window_focused }, context.getResources().getDrawable(R.drawable.my_background)); That seems to work - but if I display a menu in the parent activity, the background reverts to transparent again. When the menu is hidden, the background comes back to the drawable I had used for the override. I'm not sure what states I could override to fix the menu-display- state-issue - but I'm not sure if this is even a proper use of StateListDrawables. I could just make my own sld to mimic what the one bundled with android does, but if I make its highlight state orange for example, it'll look strange on some devices that have changed the focus color to green for example with listviews (droid eris for example). It'd be great to keep everything consistent. Below is the xml def for android.R.drawable.list_selector_background. If anyone knows what states to change for the menu display, that'd be great. Thanks selector xmlns:android=http://schemas.android.com/apk/res/ android item android:state_window_focused=false android:drawable=@color/transparent / !-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -- item android:state_focused=true android:state_enabled=false android:state_pressed=true android:drawable=@drawable/ list_selector_background_disabled / item android:state_focused=true android:state_enabled=false android:drawable=@drawable/ list_selector_background_disabled / item android:state_focused=true android:state_pressed=true android:drawable=@drawable/ list_selector_background_transition / item android:state_focused=false android:state_pressed=true android:drawable=@drawable/ list_selector_background_transition / item android:state_focused=true android:drawable=@drawable/ list_selector_background_focus / /selector -- 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] Exposing data to third-party apps in a synchronous call?
Hi, I've got an application, and I'd like to publish a way for third-party services to get data from it. Ideally I could expose this through intents, as in the following pseudocode: // third party apps class ThirdPartyService extends Service { @Override public void onCreate() { Intent i = new Intent(this, com.me.test.MyAppIntent); Intent result = startActivity(i); } } // part of my app class MyAppIntent extends Activity { @Override public void onCreate() { Intent i = new Intent(); i.putExtra(result, hi there); setResult(i); finish(); } } The above won't work of course - I have some work done on this, just wondering if anyone has any recommendations or best practices? 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: Exposing data to third-party apps in a synchronous call?
Yeah exactly, I was wondering if I was missing a way to pass data synchronously using intents, similar in a sense to the way activities can do it with startActivityForResult(). I haven't looked at the aidl remote service stuff in about a year, and forgot whether that lets the processes communicate synchronously, but it seems like a good deal more code to add to support it. There is also the content provider as you mentioned, I'm not sure if that allows synchronous access. I implemented a simple asynchronous scheme for now as follows: class ThirdPartyService extends Service { void doWork() { Intent intent = new Intent(); intent.setClassName(myapp, myapp.MyService); intent.putExtra(callbackpackage, thirdpartyapp); intent.putExtra(callbackclassname, ThirdPartyReceiver); startService(intent); } } class ThirdPartyReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { .. do something with the data sent back from my app .. } } class MyService extends IntentService { @Override public void onHandleIntent(Intent intent) { Intent i = new Intent(); i.setClassName( intent.getStringExtra(callbackpackage), intent.getStringExtra(callbackclassname)); i.putExtra(somedata, hi there); sendBroadcast(i); } } So the third party sends an intent which gets picked up by MyService. They supply their package and classname as extras in the intent. After my service is done working, I can broadcast a result intent back to them (I could send it via startActivity() too). They have to mark their receiver as exported=true. Then they can do whatever they want with the data in the intent. It works, but it's not as convenient (for the third party) as exposing some asynchronous call mechanism. Then they will get the data in the calling context. I'll check out the content provider and the aidl interfaces to see if those would be more convenient, Thanks On Sep 17, 12:35 pm, Kostya Vasilyev kmans...@gmail.com wrote: Mark, Your subject says synchronous - afaik, only content providers are synchronous. Service startup / binding is asynchronous, binder requires a service (although I could be wrong on this one), and so is asynchronous as well. Intents are of course asynchronous too. A content provider doesn't have to be backed by SQL, or to really implement data storage - you could pass various commands encoded in the URI, returning results in your own Cursor implementation. If you are keen on using intents, though - your code is pretty close, but you need to use startActivityForResult rather than startActivity, so that you can retrieve the result (set with setResult) later. This can't be used from a Service, only from an Activity, though. -- Kostya 17.09.2010 20:02, Mark Wyszomierski пишет: Hi, I've got an application, and I'd like to publish a way for third-party services to get data from it. Ideally I could expose this through intents, as in the following pseudocode: // third party apps class ThirdPartyService extends Service { @Override public void onCreate() { Intent i = new Intent(this, com.me.test.MyAppIntent); Intent result = startActivity(i); } } // part of my app class MyAppIntent extends Activity { @Override public void onCreate() { Intent i = new Intent(); i.putExtra(result, hi there); setResult(i); finish(); } } The above won't work of course - I have some work done on this, just wondering if anyone has any recommendations or best practices? Thanks -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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] Same color specified in xml file and png appear differently?
Hi, I have a 9 png which is used as the background of a view, the stretchable region has a color of: #ebebeb I have a view next to it, and I've set its background color like so: LinearLayout android:background=#ebebeb when the two views are beside one another, you can clearly tell that the colors are not the same, they're different shades of grey. I'm seeing this on the emulators, haven't had a chance to try it on a device. Is this expected, or is there something I'm doing wrong in the color declaration? 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] Get a parcel from intent's extras?
Hi, I've implemented parcelable on a class of mine per the doc instructions, works fine: public class MyParcelable implements Parcelable { ... public static final Parcelable.CreatorMyParcelable CREATOR = new Parcelable.CreatorMyParcelable() { public MyParcelable createFromParcel(Parcel in) { return new MyParcelable(in); } ... }; } I'm interested in the createFromParcel() method. I pass an instance of MyParcelable to a new activity like this: Intent intent = new Intent(...); intent.putExtra(key, myParcelableInstance); startActivity(intent); and pick it up from the new activity like this: MyParcelable mp = (MyParcelable)getIntent().getExtras().getParcelable(key); I'd like to make a copy of the MyParcelable instance, like so: MyParcelable mp2 = new MyParcelable(mp); but I haven't implemented a copy constructor. However, the createFromParcel() method which I did implement is almost like a copy constructor. I'm wondering if I can use it make a copy, but I can't figure out how to get a Parcel instance from the intent extras: MyParcelable mp2 = MyParcelable.CREATOR.createFromParcel( getIntent().getExtras().getParcelable(key)); // ? just need a parcel ? it's not the greatest idea, just wondering if it's possible to avoid making another method for my class which will almost be identical to what's already implemented for the Parcelable interface, 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: Any way to animate a 2D Game Smooth without OpenGL ?
I had similar problems trying to get a smooth game loop going, I just couldn't get rid of gcs happening (I think some were occurring outside my app too). I think I had removed everything from the draw loop in frustration except for drawing a rectangle, but would still get the bumps. That was about 7 months ago, hadn't had a chance to try any other improvements since then. On Sep 14, 7:24 am, Greg Donald gdon...@gmail.com wrote: On Tue, Sep 14, 2010 at 8:39 AM, Justin Giles jtgi...@gmail.com wrote: 3) You might check out Andenginehttp://www.andengine.org(not affiliated with them). It is a 2D opengl framework that is a whole heck of a lot easier to get a 2D game up and running than using raw openGL (in my opinion). AndEngine +1 I love my new OpenGL crutch. -- Greg Donald destiney.com | gregdonald.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] Does TabWidget.setDividerDrawable() work?
Hi, Is TabWidget.setDividerDrawable() functional? I'm trying to use it, passing it a 1px-wide 9 png stretchable, but no dividers are drawn between my tabs: tabWidget.setDividerDrawable(R.drawable.myDivider); when used, touches then seem to break, like if I tap the 1st tab, the 3rd then gets selected. If I tap the last tab, I get a force close as I guess it thinks I'm trying to click a tab index that does not exist, 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] Setting layout attributes based on android OS version?
Hi, Is there a way to specify a background in a layout based on OS version?: android:background_1.5=@color/white android:background_above_1.5=@drawable/mybackground I'm running into a problem where using a 9 png drawable for the background causes a stack overflow exception on a listview item (stack trace shows its related to a child TextView - drawText()). The layout is simple: LinearLayout ImageView / TextView / /LinearLayout and the background works fine on 1.6 and above. It's just 1.5 that's having the issue. If I set the background to be a color, it works fine. 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: Setting layout attributes based on android OS version?
Yes, I can easily set the background drawable in java code at runtime, it would just be easier to maintain if I could specify the quirk in the xml file - just wondering if there's a way to do it, if not, I'll just modify at runtime, Thanks On Sep 14, 10:18 am, Frank Weiss fewe...@gmail.com wrote: You understand that the XML only creates and initializes a view graph? The view graph itself is accessible at run 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: Setting layout attributes based on android OS version?
Cool I'll check out those facilities. Pasting the exact layout below. I can't nail down exactly what's causing this. The first render of the listview works ok. The first attempt to scroll generates the exception (pasted below). I tried using a 9 png drawable direct from the android project, same behavior. If I just get rid of background drawable specified in the top-level linear layout, it works fine. The parent listview has nothing custom in it, just part of a ListActivity: LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/catastrophe ImageView android:layout_height=44dip android:layout_width=44dip android:gravity=center_vertical / LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical TextView android:layout_width=fill_parent android:layout_height=wrap_content / TextView android:layout_width=fill_parent android:layout_height=wrap_content / TextView android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout /LinearLayout Exception: 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): java.lang.StackOverflowError 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.graphics.Canvas.drawText(Canvas.java:1269) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.text.Layout.draw(Layout.java:337) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.TextView.onDraw(TextView.java:3921) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5838) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1484) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.buildDrawingCache(View.java:5617) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.getDrawingCache(View.java:5458) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1422) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.ListView.dispatchDraw(ListView.java:2820) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.AbsListView.draw(AbsListView.java:2121) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1484) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.FrameLayout.draw(FrameLayout.java:352) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1484) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1484) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.FrameLayout.draw(FrameLayout.java:352) 09-14 17:26:03.497:
[android-developers] Re: Setting layout attributes based on android OS version?
A bit of additional information found through more testing - if I restrict each of the textviews to be at most one line with the following: android:maxLines=1 android:singleLine=true then it works fine (even with the background drawable set). If I let any one of the text views go more than one line in height, the exception will be thrown. It is thrown as soon as I start scrolling (for example, even if I scroll very slowly, by one pixel). My list adapter isn't getting called to fetch another view as all are on screen at this point, it looks like some drawing state which happens when the list is being animated maybe? I'm not sure what other combinations I can try here in attributes on the text views, I was hoping that setting: android:ellipsize=none android:singleLine=false would get around whatever state it being hit, but no luck, Thanks On Sep 14, 11:29 am, Mark Wyszomierski mar...@gmail.com wrote: Cool I'll check out those facilities. Pasting the exact layout below. I can't nail down exactly what's causing this. The first render of the listview works ok. The first attempt to scroll generates the exception (pasted below). I tried using a 9 png drawable direct from the android project, same behavior. If I just get rid of background drawable specified in the top-level linear layout, it works fine. The parent listview has nothing custom in it, just part of a ListActivity: LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/catastrophe ImageView android:layout_height=44dip android:layout_width=44dip android:gravity=center_vertical / LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical TextView android:layout_width=fill_parent android:layout_height=wrap_content / TextView android:layout_width=fill_parent android:layout_height=wrap_content / TextView android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout /LinearLayout Exception: 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): java.lang.StackOverflowError 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.graphics.Canvas.drawText(Canvas.java:1269) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.text.Layout.draw(Layout.java:337) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.TextView.onDraw(TextView.java:3921) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5838) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1484) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.buildDrawingCache(View.java:5617) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.getDrawingCache(View.java:5458) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1422) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.AbsListView.dispatchDraw(AbsListView.java:1319) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.ListView.dispatchDraw(ListView.java:2820) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.AbsListView.draw(AbsListView.java:2121) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1484) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.View.draw(View.java:5841) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.widget.FrameLayout.draw(FrameLayout.java:352) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.drawChild(ViewGroup.java:1486) 09-14 17:26:03.497: ERROR/AndroidRuntime(2099): at android.view.ViewGroup.dispatchDraw(ViewGroup.java
[android-developers] Getting TabWidget.setDividerDrawable() to work?
Hi, I've got a TabHost/TabWidget, I'm supplying custom views for each of the tabs, works great. I'm not sure if setting the divider drawable and the left and right strips is working as I'm assuming. Basically I supply a drawable, and no divider is drawn, nor is the left/right strips. Are those methods meant to be used for this? When I look at the tab drawables in the project, it looks like they have the dividers and strips baked into the tab drawable resources themselves. Does anyone have this working?: // The drawable is a dummy png that is 1px wide and 65px tall: mTabHost.getTabWidget().setDividerDrawable( R.drawable.mydividerdrawable); 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] TextColor attribute doesn't get applied to Button from a style def?
Hi, I have a button, and am applying a text style to it: Button android:textAppearance=@style/foo / the color defined in the style doesn't get applied to the button though: style name=foo item name=android:textSize18dip/item item name=android:textColor#F00/item /style the other style elements do get applied though (like the textSize). I can get the text color to change if I explicitly set it on the button: Button android:textAppearance=@style/foo android:textColor=#F00 / am I doing something wrong? 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] ListView - still draw dividers between disabled elements?
Hi, In a ListView, disabled elements don't get their divider drawable drawn. Is there a way to change that? I always would like the dividers drawn, regardless if an element is disabled. This post is pretty close to what I'm looking at: http://groups.google.com/group/android-developers/browse_thread/thread/ba8889a34763459f/3379c2d6816f745c?lnk=gstq=listview+divider+enabled#3379c2d6816f745c 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] Pass text style from compound view to child text view?
Hi, How can we pass through a text style to our own compound control? For example, I have the following: com.me.test.MyCompoundView android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=@style/TextStyleFoo public class MyCompoundView extends LinearLayout { TextView mTextView; public MyCompoundView(Context context, AttributeSet attrs) { super(context, attrs); TypedArray a = context.obtainStyledAttributes(...); // How do we pass the text style in the xml def // to our child textview here? mTextView.setTypeFace(...?...); } } yeah I'm not sure what the correct way to do it is, thanks for any pointers, Mark -- 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 variables from tab activity in the child activities
I think you'd have to use static variables (a singleton could be nice), write to the prefs, stuff like that. On Sep 8, 1:31 pm, tatebn brandonnt...@gmail.com wrote: If I have a tab activity with multiple tabs, each containing a different activity, is it possible to have a variable in the tab activity and access it from the child activities? How would I do that? -- 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: Where is the View.setStyle() method?
Ok thanks, I'll use the dimension resource facility, was not aware of it, Thanks On Sep 3, 9:52 pm, Dianne Hackborn hack...@android.com wrote: Also you can pass a style resource in to the constructor. There is no setStyle() method because you can't change the style after the view is initialized. On Fri, Sep 3, 2010 at 3:20 PM, Mark Murphy mmur...@commonsware.com wrote: On Fri, Sep 3, 2010 at 6:01 PM, Mark Wyszomierski mar...@gmail.com wrote: Ah well, is there any better and new way of setting pixel sizes at least for a view? For example, my two styles had different image widths: // style1: layout_width=25dip // style2: layout_width=50dip Why not use dimension resources? Doing something like this: myView.setLayoutParams(new LinearLayout.LayoutParams(50, 50)); would not set the sizes in dip, scaled for the current device display specifics. Why not use dimension resources? getDimension() will apply the scaling for you. I could grab the device density and scale myself, but are there any other better ways of doing this? Why not use... Oh, well, you get the picture. :-) -- Mark Murphy (a Commons Guy) http://commonsware.com|http://github.com/commonsguy http://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 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.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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] Where is the View.setStyle() method?
Hi, Is there a way to set a style for a View at runtime? I've seen this question a few times on the board here but no answers, so probably not: ImageView android:id=@+id/blah style=@style/mystyle / // later... ImageView iv = (ImageView)findViewById(...); iv.setStyle(R.style.myotherstyle); is it not possible to do something like this? We have to manually change everything in code instead? 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: Where is the View.setStyle() method?
Ah well, is there any better and new way of setting pixel sizes at least for a view? For example, my two styles had different image widths: // style1: layout_width=25dip // style2: layout_width=50dip Doing something like this: myView.setLayoutParams(new LinearLayout.LayoutParams(50, 50)); would not set the sizes in dip, scaled for the current device display specifics. I could grab the device density and scale myself, but are there any other better ways of doing this? Like if I could read the values from my styles in styles.xml and let it rescale for me? I doubt it, but just wondering if there's some way to utilize the dip system, Thanks On Sep 3, 2:51 pm, Mark Murphy mmur...@commonsware.com wrote: On Fri, Sep 3, 2010 at 5:42 PM, Mark Wyszomierski mar...@gmail.com wrote: Is there a way to set a style for a View at runtime? Not that I am aware of, sorry. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 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] Sync Adapter and api level 3 4?
Hi, I'm looking at the sample sync adapter here: http://developer.android.com/resources/samples/SampleSyncAdapter/index.html I'd like to still support sdk level 3 and 4 devices. Will including the following lines in my app's manifest be problematic?: uses-permission android:name=android.permission.AUTHENTICATE_ACCOUNTS / uses-permission android:name=android.permission.READ_SYNC_STATS / are these specific to sdk level 5? Ideally, we could include these for level 3 and 4 users, and they just won't be shown the contact sync option at all. Is this how it's meant to work? 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: Sync Adapter and api level 3 4?
Hi Dianne, Thanks, I should have posted this fragment as well, what about these references: service android:name=.authenticator.AuthenticationService action android:name=android.accounts.AccountAuthenticator / action android:name=android.content.SyncAdapter / these are service definitions, will the references to android.accounts.* also just be ignored? Thanks again, sample extract below: from the sample: application android:icon=@drawable/icon android:label=@string/label !-- The authenticator service -- service android:name=.authenticator.AuthenticationService android:exported=true intent-filter action android:name=android.accounts.AccountAuthenticator / /intent-filter meta-data android:name=android.accounts.AccountAuthenticator android:resource=@xml/authenticator / /service service android:name=.syncadapter.SyncService android:exported=true intent-filter action android:name=android.content.SyncAdapter / /intent-filter meta-data android:name=android.content.SyncAdapter android:resource=@xml/syncadapter / meta-data android:name=android.provider.CONTACTS_STRUCTURE android:resource=@xml/contacts / /service On Jul 30, 11:26 am, Dianne Hackborn hack...@android.com wrote: Yes permissions on older platforms will be ignored. Since older platforms don't know about sync adapters, they just won't do anything with them. Do be sure of course to test your code on an older platform to be sure all is well, though. On Fri, Jul 30, 2010 at 11:17 AM, Mark Wyszomierski mar...@gmail.comwrote: Hi, I'm looking at the sample sync adapter here: http://developer.android.com/resources/samples/SampleSyncAdapter/inde... I'd like to still support sdk level 3 and 4 devices. Will including the following lines in my app's manifest be problematic?: uses-permission android:name=android.permission.AUTHENTICATE_ACCOUNTS / uses-permission android:name=android.permission.READ_SYNC_STATS / are these specific to sdk level 5? Ideally, we could include these for level 3 and 4 users, and they just won't be shown the contact sync option at all. Is this how it's meant to work? 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.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: Image viewers on android phones not always the best experience?
I have to check again, but I thought webview won't center and zoom a single image for you. It will just show the full size image, if it's larger than the phone screen, it'll just scroll off. On Thu, Jul 15, 2010 at 4:33 PM, Maps.Huge.Info (Maps API Guru) cor...@gmail.com wrote: You can always use a webview. It's pretty easy to write your own method or use the default. Images in webview seem to work quite well and start fairly fast. -John Coryat -- 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 at http://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] Image viewers on android phones not always the best experience?
Hi, I'm trying to use an image-display intent to..display an image: Uri uri = ...; Intent intent = new Intent(android.content.Intent.ACTION_VIEW); intent.setDataAndType(uri, image/ + extension); startActivity(intent); this works well, but some devices have image viewers that handle this intent which are sub-optimal. For example, on the Nexus One, it looks like an image gallery application starts up - this takes about 10+ seconds before showing the image. On the Droid, an image application starts up very quickly and shows the image right away. If we shouldn't rely on the above intent to provide a good experience for the user, is there another method anyone is using? Would just like to know before I try writing something myself, 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] Any api for mapview callout/bubble for tapped pins?
Hi, There's no method available to us to display a callout / bubble above an ItemizedOverlay item when, tapped, right? I don't think there is, just wondering if I'm missing this in the docs before I start my own, 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] Making a jar of an android project for use by third party apps?
Hi, I've made an activity which uses some image resources. I'd like to make it available to other projects by packaging it as a jar. The project is opensource - the goal of making it a jar would just be convenience for the end developer. I'm not sure that this is possible though - since the jar is being created at the top level of my project's directory structure, it will include all resources like string.xml, icon.png, etc. The projects that import my jar will likely have resources with the same names, which will probably be a problem since android resources aren't namespaced, if I understand correctly. Is there a way to export custom-made activities/views which need to internally reference their own set of resources? 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: Making a jar of an android project for use by third party apps?
Awesome, will check it out, thanks Mark. On Jun 15, 3:29 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Jun 15, 2010 at 6:24 PM, Mark Wyszomierski mar...@gmail.com wrote: I've made an activity which uses some image resources. I'd like to make it available to other projects by packaging it as a jar. The project is opensource - the goal of making it a jar would just be convenience for the end developer. I'm not sure that this is possible though - since the jar is being created at the top level of my project's directory structure, it will include all resources like string.xml, icon.png, etc. The projects that import my jar will likely have resources with the same names, which will probably be a problem since android resources aren't namespaced, if I understand correctly. Is there a way to export custom-made activities/views which need to internally reference their own set of resources? I set up some tech for this as part of the Android Parcel Project: http://andparcel.com/ In particular, these instructions for creating a parcel may be of interest: http://andparcel.com/pdfs/parcel-dev.pdf Also, the current version of _The Busy Coder's Guide to Advanced Android Development_ has a chapter on creating reusable components like these. Since you're a subscriber, you should have access to this version of the book. -- Mark Murphy CommonsWare mmur...@commonsware.comhttp://commonsware.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] Anyone using the new facebook sdk for android?
Hi, Anyone try using the facebook sdk for android?: http://github.com/facebook/facebook-android-sdk there are a few problems with it, most frustrating is that they're not managing the login dialog correctly - rotating the device will hide the dialog and leak it, sigh. I was going to repackage it with correct management, just wondering if anyone else has done it before I try. Also wondering if anyone has a decent way of contacting the fb developers about it so at least the patch could be reused, if I make it, 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] App not showing up for Evo users?
Hi, I'm working on a project (Foursquare). I pushed a new version to marketplace last night, but it is not showing up in marketplace searches for Evo users. I've read about this happening to other apps, and one major reason seems to be if copy protection is being used (but it is not for the Foursquare app). Anyone else have an idea why this is happening? Is there a set of permissions Evo doesn't support which may be blocking the app from showing up in marketplace? 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: App not showing up for Evo users?
Thanks, Mark, will try getting in touch with them, Mark On Jun 8, 5:47 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: I'm working on a project (Foursquare). I pushed a new version to marketplace last night, but it is not showing up in marketplace searches for Evo users. I've read about this happening to other apps, and one major reason seems to be if copy protection is being used (but it is not for the Foursquare app). Anyone else have an idea why this is happening? Is there a set of permissions Evo doesn't support which may be blocking the app from showing up in marketplace? I can confirm your EVO problem, on both the old and new firmware (Sprint pushed me an update just as I was looking at your problem). The Market has apparently been acting a little odd recently, so your issues may stem from that. Foursquare is a big enough name that you hopefully have some contacts within Google that you can leverage to figure out what is going on. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org -- 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
Re: [android-developers] Re: App not showing up for Evo users?
Things seem to be getting back to normal, foursquare is now appearing for those users again (it was affecting users on evo, eris, possibly others). I hope everything is ok for others now too, Thanks On Tue, Jun 8, 2010 at 6:13 AM, Mark Wyszomierski mar...@gmail.com wrote: Thanks, Mark, will try getting in touch with them, Mark On Jun 8, 5:47 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: I'm working on a project (Foursquare). I pushed a new version to marketplace last night, but it is not showing up in marketplace searches for Evo users. I've read about this happening to other apps, and one major reason seems to be if copy protection is being used (but it is not for the Foursquare app). Anyone else have an idea why this is happening? Is there a set of permissions Evo doesn't support which may be blocking the app from showing up in marketplace? I can confirm your EVO problem, on both the old and new firmware (Sprint pushed me an update just as I was looking at your problem). The Market has apparently been acting a little odd recently, so your issues may stem from that. Foursquare is a big enough name that you hopefully have some contacts within Google that you can leverage to figure out what is going on. -- Mark Murphy (a Commons Guy)http://commonsware.com| http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org -- 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 at http://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] Do scheduled alarms persist between app upgrades?
Hi, My app schedules an alarm, like: AlarmManager mgr = (AlarmManager)context.getSystemService( Context.ALARM_SERVICE); mgr.setRepeating(...); with the alarm scheduled, what happens if I release a new version of my app, and the user upgrades the app? Will this alarm be removed? Or will it be left untouched, and fired as expected? 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] Multiple notifications, single icon on notification bar?
Hi, If I do: for (int i = 0; i 3; i++) { NotificationManager.notify(i, notification); } I'll get three notification icons on the notification bar, and three list items in the pull down. Is there a way to use only one icon on the notification bar, but still keep three entries in the pull down? I tried doing: for (int i = 0; i 3; i++) { if (i 0) { notification.number = -1; } NotificationManager.notify(i, notification); } but no luck. The docs say that setting notification.number to zero or a negative # will prevent it from showing up on the notifications bar, 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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?
If I understand your question correctly, then yes. In your manifest, just set the following: uses-sdk android:minSdkVersion=3 android:targetSdkVersion=6 / the app will still work on 1.5+. Just make sure you don't use any SDK methods that don't exist on earlier platforms without checking the user's local sdk version. On May 11, 9:53 am, HeHe cnm...@gmail.com wrote: the slowness of system clock with SDK 1.6 makes debugging of my app that heavily depends on correct clock timing impossible. hence, i would like to know if i can develop app for Android 1.5/1.6 using more recently released SDK (eg. 2.0)? if yes, how? thanks in advancet for any advice!! -- 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] Finding a google business page?
Hi, I have an app which does some work with local businesses. I'd like to offer the user a button which could bring up a google business page for the business. These pages look like: http://maps.google.com/places/us/san-francisco/guerrero-st/600/-tartine-bakery if I have a name of a business, like John's Pizza Place, is there a maps API I can use to get a list of matching google business pages to show the user, then they can basically click one of the results and see the corresponding page in an external browser instance? 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] setContentView() twice on an activity?
Hi, What is the effect of calling setContentView() in an activity twice? My situation: class A extends Activity { protected TextView mLabel; public void onCreate() { super.onCreate(); setContentView(R.layout.a); mLabel = (TextView)findViewById(R.id.label); } } class B extends A { protected ImageView mImageView; public void onCreate() { super.onCreate(); setContentView(R.layout.b); mImageView = (ImageView)findViewById(R.id.photo); mLabel.setText(hello); } } this works, but not sure if it's ok to do this. Basically the parent activity initializes a bunch of stuff that B will use too, B just wants to add an additional ImageView for itself. So layout.a and layout.b are the same, they're a copy-paste of one another. B just has an extra ImageView appended. 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Simple bluetooth presence detection?
Hi, Really general, very new to bluetooth. Can we have one android device broadcasting a simple 'hello' bluetooth network (maybe a radius of just a few feet) - then when other android devices come into that area, reply with a 'hello' back? The client devices moving through the 'hello' radius wouldn't need to be always be checking for presence. I'd let the user open an app and check for bluetooth networks nearby. If they find one of these hubs, they can then choose to broadcast back a hello. Is that at all possible? Any general info would be great, 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Set Spinner select to 'none' ?
Hi, Is there a way to set a Spinner's selection to 'none' ? When my activity launches, it looks like a spinner will automatically select the 0th element in the spinner. I'd like to explicitly make the user choose a selection instead. 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Setting text style for a Spinner?
Hi, I have a Spinner in a resource file. I'm giving it an ArrayAdapterString to show. What's the right way to style the font used by the spinner? I'd like to change the size of the text and its color. I tried: Spinner android:layout_width=fill_parent android:layout_height=wrap_content android:textAppearance=@style/mystyle / but it's not being honored, 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: How to indicate to user that a row is long-clickable?
Long-click is a cool mechanism for exposing more options, it would be neat if there was some UI guideline that the android team could come up with to indicate to users that a row has this capability, Thanks On Mar 23, 5:58 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: I have a ListView. I let the user perform some action on a long-click (pop up a picker dialog with a few choices) on row items. Is there any typical UI mechanism that should be used to let the user know that they can long-click a row item? Right now I feel like users would have no idea to long-click the rows for a list of choices. I'm not aware of any hints for this. IMHO, long-click should be a power user thing. Make sure anything that can be done by that mechanism can be done by some other means that is more discoverable. For example, in the Contacts app, you can long-tap to delete a contact, but you can also tap on the contact, bring up the contact details activity, and do a delete from the option menu. The option menu is a bit more discoverable because there's a button for it. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Beginning Android_ from Apress Now 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] How to indicate to user that a row is long-clickable?
Hi, I have a ListView. I let the user perform some action on a long-click (pop up a picker dialog with a few choices) on row items. Is there any typical UI mechanism that should be used to let the user know that they can long-click a row item? Right now I feel like users would have no idea to long-click the rows for a list of choices. 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Is app's first run?
Hi, Is there any way to tell whether an application is being run for the first time, other than checking if there are any left over preferences / files from a previous run? 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: Is app's first run?
Otherwise, checking for files/databases/preferences is pretty typical AFAIK. This sounds like my best bet - so you're saying at app startup, I can check if files/databases/preferences exists - if it does, this is not my first run, if it is missing, then it's my first run? Thanks On Mar 18, 11:41 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Is there any way to tell whether an application is being run for the first time, other than checking if there are any left over preferences / files from a previous run? While your app can't receive a broadcast Intent saying it was installed, I think you can receive one saying you were updated, if that helps. Otherwise, checking for files/databases/preferences is pretty typical AFAIK. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 app's first run?
Yeah that definition is perfect, having a little trouble implementing it though. I'm just trying to use: File file = getFilesDir(); this points to: /data/data/com.foo.bar/files which is empty though, nothing gets written there during my app's lifetime. My app's directory structure looks like this: com/foo.bar /cache /databases webviewstuff.db /files /lib /shared_prefs com.foo.bar_preferences.xml should I be seeing databases/preferences? Or am I supposed to be looking for the existence of /shared_prefs/ com.foo.bar_preferences.xml. If so, is there a proper way to resolve that path other than kind of hard-coding it into my app? Thank you On Mar 18, 11:50 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Otherwise, checking for files/databases/preferences is pretty typical AFAIK. This sounds like my best bet - so you're saying at app startup, I can check if files/databases/preferences exists - if it does, this is not my first run, if it is missing, then it's my first run? For a sufficiently-generous definition of first run, yes. You will not be able to distinguish between install and install-uninstall-reinstall this way. Hopefully, that distinction does not matter. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android App Developer Training:http://commonsware.com/training -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Re: Is app's first run?
Yeah that works perfectly, in my situation I'm working on an existing project that is already in the wild, so I can't rely on a value in the preferences file to check for this though. That would be the best solution I think. To get around this, I can do something like the following (going off your original solution): File file = new File(/data/data/com.foo.bar/shared_prefs/ com.foo.bar_preferences.xml); if (file.exists()) { ... } that is one big hard-coded string, but the existence of this file seems to work ok. I guess it's alright? Thanks On Mar 18, 12:47 pm, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Yeah that definition is perfect, having a little trouble implementing it though. I'm just trying to use: File file = getFilesDir(); this points to: /data/data/com.foo.bar/files which is empty though, nothing gets written there during my app's lifetime. My app's directory structure looks like this: com/foo.bar /cache /databases webviewstuff.db /files /lib /shared_prefs com.foo.bar_preferences.xml should I be seeing databases/preferences? Or am I supposed to be looking for the existence of /shared_prefs/ com.foo.bar_preferences.xml. If so, is there a proper way to resolve that path other than kind of hard-coding it into my app? If you have shared preferences, then you can do this: Step #1: Get your shared preferences (hopefully PreferenceManager.getDefaultSharedPreferences()) Step #2: Look for the hey! I've been run before preference Step #2a: If that preference is not found, it's your first run, so set that preference (and commit() the change) and do your first-run logic Step #2b: If that preference is found, you've been run before, so...ummm...carry on, or whatever -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
[android-developers] Show activity on search button press?
Hi, Is there a way to launch an activity when the device's search key is pressed? I know we can hook into the search feature of android instead. But I'm trying to fix a broken app quickly. Ideally whenever the search key is pressed (if my app is visible) then one of my activities is started. 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] Restarting an activity within a tab (TabActivity)
Hi, I have a TabActivity, each tab holds an activity. At some point I'd like to 'refresh' the tabs. I'd basically like to restart each activity in the tabs. I'm not sure how to do this. Calling: getTabHost().clearTabs(); removes the tabs, but the activities still seem to be in alive, in limbo. How can I get them to really quit? 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] Forward activity resultCode?
Hi, Is it possible to forward a result like the following?: ActivityA startActivityForResult(intentB, 22); ActivityB startActivityForResult(intentC, 22); finish(); ActivityC setResult(99); finish(); is it possible to get A's onActivityResult() to fire here and catch the value 99 as the resultCode? B excuses itself from the stack, so really A becomes the parent of C in this scenario. 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: Forward activity resultCode?
That's perfect, thanks Dianne. This is how it looks now for reference: ActivityA startActivityForResult(intentB, 22); ActivityB intentC.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); startActivity(intentC); finish(); ActivityC setResult(99); finish(); I just had to modify ActivityB's call from startActivityForResult() to startActivity() otherwise it throws an exception since that flag is specified on the intent, but the error message is very descriptive and excellent, Thanks On Mar 11, 12:07 am, Dianne Hackborn hack...@android.com wrote: In B, set this flag in the Intent you are starting: http://developer.android.com/reference/android/content/Intent.html#FL... On Thu, Mar 11, 2010 at 12:04 AM, Mark Wyszomierski mar...@gmail.comwrote: Hi, Is it possible to forward a result like the following?: ActivityA startActivityForResult(intentB, 22); ActivityB startActivityForResult(intentC, 22); finish(); ActivityC setResult(99); finish(); is it possible to get A's onActivityResult() to fire here and catch the value 99 as the resultCode? B excuses itself from the stack, so really A becomes the parent of C in this scenario. 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.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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] Supplying a different background drawable for a dialog?
Hi, I'm trying to supply my own background drawable for a dialog. It works fine on 1.6+, on 1.5 though instead of a transparent dimmed background around the dialog, I just get opaque black. I defined the style like this in my styles.xml file: style name=CustomDlg parent=@android:style/Theme.Dialog item name=android:windowBackground@drawable/my_background/ item /style Is there something else we need to do so that we can still get the transparency around the dialog? The drawable is nothing special, I just took the stock one from the aop and changed the color on the inside of the frame. 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: Supplying a different background drawable for a dialog?
I just took the original image from the android assets folder, changed the color, and save it out in photoshop. If it weren't set to 0, then wouldn't it also be opaque on 1.6+ ? Someone recommended I try this: WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.dimAmount=0.2f; getWindow().setAttributes(lp); in the dialog onCreate() method. Gave it a shot, but no effect on 1.5 either. Works perfectly on 1.6+. I think there's something wrong with 1.5. Any ideas? Thanks On Mar 11, 11:36 am, ivar innovativer...@gmail.com wrote: While changing the color of the panel, did you set the alpha value to FF? 0 gives you full transparency and FF gives you total opacity. Hope this helps. Ivar On Mar 11, 8:37 pm, Mark Wyszomierski mar...@gmail.com wrote: Hi, I'm trying to supply my own background drawable for a dialog. It works fine on 1.6+, on 1.5 though instead of a transparent dimmed background around the dialog, I just get opaque black. I defined the style like this in my styles.xml file: style name=CustomDlg parent=@android:style/Theme.Dialog item name=android:windowBackground@drawable/my_background/ item /style Is there something else we need to do so that we can still get the transparency around the dialog? The drawable is nothing special, I just took the stock one from the aop and changed the color on the inside of the frame. 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] Making a clickable LinearLayout change color on click?
Hi, I have a linear layout, and I wanted to set its background to be a rounded rect. I defined the background like so: shape xmlns:android=http://schemas.android.com/apk/res/android; stroke android:width=1dip / padding android:left=7dip android:top=7dip android:right=7dip android:bottom=7dip / corners android:radius=4dip / /shape that works ok, but I also wanted to make the background turn orange when clicked (like as in a listview). In the past, I've done this to get that effect: myView.setBackgroundDrawable( getDrawable(android.R.drawable.list_selector_background)); but this will just override the shape background definition I supplied above. Do I have to make a state list, comprised of my shape definition above, and another shape definition where the background is orange? 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] Reading back one of my own parcelables?
Hi, I implemented Parcelable on two of my classes, and one class contains instances of the other. I'm not sure how to read them back in. Here's an example: public class Farm implements Parcelable { ArrayListHorse mHorses; // Horse implements parcelable too. @Override public void writeToParcel(Parcel out, int flags) { out.writeInt(mHorses.size()); for (Horse it : mHorses) { out.writeParcelable(it, flags); } } private Farm(Parcel in) { mHorses = new ArrayListHorse(); int numHorses = in.readInt(); for (int i = 0; i numHorses; i++) { Horse horse = Horse.CREATOR.createFromParcel(in); mHorses.add(horse); } } } Is the way I'm reading them back in correct? 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: Reading back one of my own parcelables?
It looks like it works, Thanks, Mark On Mar 8, 4:36 pm, Mark Wyszomierski mar...@gmail.com wrote: Hi, I implemented Parcelable on two of my classes, and one class contains instances of the other. I'm not sure how to read them back in. Here's an example: public class Farm implements Parcelable { ArrayListHorse mHorses; // Horse implements parcelable too. @Override public void writeToParcel(Parcel out, int flags) { out.writeInt(mHorses.size()); for (Horse it : mHorses) { out.writeParcelable(it, flags); } } private Farm(Parcel in) { mHorses = new ArrayListHorse(); int numHorses = in.readInt(); for (int i = 0; i numHorses; i++) { Horse horse = Horse.CREATOR.createFromParcel(in); mHorses.add(horse); } } } Is the way I'm reading them back in correct? 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] Wrap title of activity with dialog theme?
Hi all, I have an activity with the dialog theme applied to it. I am setting the dialog title, but the string is quite long, and instead of wrapping, it just gets truncated. Is there a way to wrap the title instead? 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] notifyDataSetChanged() on an adapter composed of child adapters?
Hi, I have an adapter class composed of several child adapters. Looks like this: public class TestAdapter extends BaseAdapter { ArrayLIstAdapter mChildAdapters; public void addAdapterChild(Adapter adapter) { mChildAdapters.add(adapter); } } it works ok, running into a problem though if one of the child adapters calls notifyDataSetChanged(). It looks like the notification is never brought upwards to TestAdapter. For example, my child adapter has a thumbnail image in each row, and I download them asynchronously. When the image download is complete, the adapter will call notifyDataSetChanged() so that the view is refreshed and the thumbnail is shown. Works fine stand-alone. When in this parent adapter, no refresh occurs. I can do this to fix it, but am worried about an infinite cycle of updates: public void addAdapterChild(Adapter adapter) { mChildAdapters.add(adapter); adapter.registerDataSetObserver(mDataSetObserver); } private DataSetObserver mDataSetObserver = new DataSetObserver() { @Override public void onChanged() { notifyDataSetChanged(); } }; so as long as this parent adapter is the one that calls notifyDataSetChanged(), the refresh occurs and the thumbnails are shown. Thanks, Mark -- 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] List adapter: failing to recycle views = lots of memory allocated?
Hi, I'm looking at List8 in the sdk api samples folder. In this example, the list adapter doesn't recycle 'convertView': public View getView(int position, View convertView, ViewGroup parent) { // Make an ImageView to show a photo ImageView i = new ImageView(mContext); i.setImageResource(mPhotos.get(position)); i.setAdjustViewBounds(true); i.setLayoutParams(new AbsListView.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); // Give it a nice background i.setBackgroundResource(R.drawable.picture_frame); return i; } I'm running this example on a nexus one. I am flinging the listview up and down, and it seems to grow the heap up to 8mb at times before releasing anything. This doesn't happen when convertView is recycled, the memory usage remains quite stable as expected. I started working on a project where there's an adapter implemented which also does not recycle convertView. Same behavior as above, I can grow the heap to 12/13mb before anything is released. So I end up seeing a lot of out of memory exceptions as I play with other parts of the app and so much memory is already allocated. There's no reason not to use convertView, and none of this behavior is unexpected. I thought though that in earlier versions of the SDK that listview would internally release views more quickly if you weren't using convertView, and were allocating all of them like in the above example? By earlier versions, I mean like the first version of the SDK two years ago, when we were trying to figure out what convertView was at all. Just curious, 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