[android-developers] SearchView focused when hiding the ActionBar menu
Hi, I have an ActionBar with a SearchView. The hidden/overflow menu items are shown on the right in a drop-down list when the menu button in the ActionBar is touched. When the drop-down menu is hidden, the SearchView is focused and the keyboard shows. Is there a way to stop the keyboard from showing (except for the case where the SearchView is touched)? In the YouTube application the cursor doesn't show up in the SearchView unless it is selected/touched and this is the behaviour I'm looking for. Regards, Julius. -- 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] Market APK device compatibility
Hi, I have an application which I have deployed to the Market and when I look at the application on the website (on my Android tablet) it says: This item is not compatible with your device Is there a way to figure out what is making the application incompatible? I can install the application directly using adb without any problems and there are no logs indicating problems in logcat. Luckily I have the same device as a customer who is wanting to install the application so I can replicate the problem. I'm just finding it frustrating that Google gives me no further detail as to what it is that they have deemed to make the application not compatible with the device. Eg. if there was something saying - you need to have a telephone in the device or, you need a touchscreen and this device doesn't have one apparently. In the Market publishing area (under Show devices link) the device isn't listed (as Supported orUnsupported - it's just not there). Can anyone point me to a logical way for me to ascertain what is wrong with my manifest (assuming that is the problem)? Regards, Julius. -- 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 APK device compatibility
Sure (but it's only published in New Zealand): https://market.android.com/details?id=nz.co.localist.android.llt I'm surprised there isn't a way to find this out... On 30/08/2011, at 8:37 PM, Mark Murphy wrote: Can you post a link to the Market listing? On Tue, Aug 30, 2011 at 4:27 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I have an application which I have deployed to the Market and when I look at the application on the website (on my Android tablet) it says: This item is not compatible with your device Is there a way to figure out what is making the application incompatible? I can install the application directly using adb without any problems and there are no logs indicating problems in logcat. Luckily I have the same device as a customer who is wanting to install the application so I can replicate the problem. I'm just finding it frustrating that Google gives me no further detail as to what it is that they have deemed to make the application not compatible with the device. Eg. if there was something saying - you need to have a telephone in the device or, you need a touchscreen and this device doesn't have one apparently. In the Market publishing area (under Show devices link) the device isn't listed (as Supported orUnsupported - it's just not there). Can anyone point me to a logical way for me to ascertain what is wrong with my manifest (assuming that is the problem)? Regards, Julius. -- 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/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 APK device compatibility
Ah thanks for the solution - I had just put that in for the next update in case it worked - thanks for that. The two devices I had that problem for were tablets. Is there any way to actually figure that out though - I mean, work backwards from a device? Regards, Julius. (Pity I missed the office hours meet this afternoon) On 30/08/2011, at 8:47 PM, Mark Murphy wrote: On Tue, Aug 30, 2011 at 4:42 AM, Julius Spencer jul...@msa.co.nz wrote: Sure (but it's only published in New Zealand): https://market.android.com/details?id=nz.co.localist.android.llt I'm surprised there isn't a way to find this out... You have the CALL_PHONE permission. If you do not also have uses-feature android:name=android.hardware.telephony android:required=false, you will not show up on tablets that are not phones (e.g., anything with Honeycomb). -- 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 2.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 APK device compatibility
Not that I am aware of. MOTODEV has some static analysis stuff (integrated in Studio for Android, plus as a separate Web thing) that might point out this issue. It would be really great if someone from the Market team noticed this as it is a little baffling and I don't really know what I can do but ask here and hope someone can help if this were to happen again. Since they won't be happening for 11 hours, you haven't missed them yet. You might be asleep or otherwise unavailable... :-) Oh weird yeah it's in the morning first thing (for me); thought it flashed past this afternoon as a notification. Cool - I have a question about Loaders catch you then. :) Thanks again - I really wouldn't know how to go about solving this problem. Regards, Julius. -- 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] Options from Fragment in Activity with multiple Fragments
Hi, I have a FragmentActivity with 3 fragments and each has its own set of options. Is it possible to have the Options for the Fragment show when the fragment is attached to the FragmentActivity? Regards, Julius. -- 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] Options from Fragment in Activity with multiple Fragments
Oh it looks like this was working after all... :) Apologies! On 12/08/2011, at 10:50 AM, Julius Spencer wrote: Hi, I have a FragmentActivity with 3 fragments and each has its own set of options. Is it possible to have the Options for the Fragment show when the fragment is attached to the FragmentActivity? Regards, Julius. -- 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] ActionBar in TabActivity
Hi, I have a TabActivity and I would like to add tabs to the ActionBar in the Honeycomb+ devices. I'm not sure how to have a TabActivity for pre Honeycomb and yet use a FragmentActivity at the same time to access the actionbar. Has anyone know how to get around this issue? Regards, Julius. -- 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] ActionBar in TabActivity
Oops just saw the updated documentation for how to do tabs here: http://developer.android.com/reference/android/app/TabActivity.html Will give that a go. On 10/08/2011, at 9:00 PM, Julius Spencer wrote: Hi, I have a TabActivity and I would like to add tabs to the ActionBar in the Honeycomb+ devices. I'm not sure how to have a TabActivity for pre Honeycomb and yet use a FragmentActivity at the same time to access the actionbar. Has anyone know how to get around this issue? Regards, Julius. -- 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
Re: [android-developers] Use CursorLoader for SQLiteDatabase?
Hi, I can't figure out how to use this if I am using a SQLiteDatabase which isn't set up as a ContentProvider. From what I remember there won't be source for Honeycomb released anytime soon so I'm not sure how I could use the Loader framework to make it work. Regards, Julius. On 31/07/2011, at 11:40 PM, H wrote: You simply call getSupportLoaderManager() which you inherit from FragmentActivity. -- 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
Re: [android-developers] Use CursorLoader for SQLiteDatabase?
Thanks for the replies. If I have a Cursor, where and how would I go about swapping the old Cursor for the new one? It appears that loadInBackground returns a new Cursor and after this deliverResult runs which closes the old Cursor and makes the swaps in the new Cursor. It looks like in deliverResult we look to see if there is an old Cursor and close it in AsyncTaskLoader's onReleaseResources and just set the member object Cursor (mApps) to the new Cursor. In the example code though I see the following and am confused: ListAppEntry oldApps = apps; mApps = apps; I'm guessing that apps is the new result, in this case a ListAppEntry. Above it looks like a new object called oldApps is being populated with the new result *as well as* the member object mApps. I would have expected it would be something like this (note the difference in the first line): ListAppEntry oldApps = mApps; mApps = apps; so when running: if (oldApps != null) { onReleaseResources(oldApps); } the oldApps Cursor (if this were a Cursor) could be closed. Can someone who wrote the example confirm my expectation or explain it? Anyhow, after deliverResult I'm guessing onLoadFinished runs. At this point, now the Cursor is refreshed, do we just need to use notifyDatasetChanged on our Adapter? A little diagram of the flow would be quite handy. If someone can confirm this flow of events I'm happy to make a diagram. Thanks for all the replies and help; I feel like I'm making progress! Thanks for the tip on onStartLoading() I think I read that in another thread, but it's great to have it confirmed again. Cheers, Julius. -- 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] Help... IllegalStateException: Couldn't init cursor window
Hi, I have been taking all my database reads off the main UI thread and have come across some new problems. I'm receiving the following error(s): ERROR/CursorWindow(26242): CursorWindow heap allocation failed followed by: ERROR/AndroidRuntime(26242): java.lang.RuntimeException: An error occured while executing doInBackground() ERROR/AndroidRuntime(26242): at android.os.AsyncTask$3.done(AsyncTask.java:200) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask.setException(FutureTask.java:125) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask.run(FutureTask.java:138) ERROR/AndroidRuntime(26242): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) ERROR/AndroidRuntime(26242): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) ERROR/AndroidRuntime(26242): at java.lang.Thread.run(Thread.java:1019) ERROR/AndroidRuntime(26242): Caused by: java.lang.IllegalStateException: Couldn't init cursor window ERROR/AndroidRuntime(26242): at android.database.CursorWindow.native_init(Native Method) ERROR/AndroidRuntime(26242): at android.database.CursorWindow.init(CursorWindow.java:41) ERROR/AndroidRuntime(26242): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:276) ERROR/AndroidRuntime(26242): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:268) ERROR/AndroidRuntime(26242): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171) ERROR/AndroidRuntime(26242): at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248) I can't seem to find much online about this and don't know what it really means. Regards, Julius. -- 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: Help... IllegalStateException: Couldn't init cursor window
The problem occurs on the line with rawQuery( ArrayListLong myIds = new ArrayListLong(); Cursor c = null; try { c = ((MyApplication) MyApplication.getApplication()).getDbHelper().getReadableDatabase().rawQuery(queryString,null); if(c.moveToFirst()) { while(!c.isAfterLast()) { myIds.add(c.getLong(c.getColumnIndex(MYID))); c.moveToNext(); } } } finally { if(null!=c) c.close(); } return myIds; Thanks for any help. On 29/07/2011, at 6:35 PM, KP wrote: Code will help. On Jul 29, 11:16 am, Julius Spencer jul...@msa.co.nz wrote: Hi, I have been taking all my database reads off the main UI thread and have come across some new problems. I'm receiving the following error(s): ERROR/CursorWindow(26242): CursorWindow heap allocation failed followed by: ERROR/AndroidRuntime(26242): java.lang.RuntimeException: An error occured while executing doInBackground() ERROR/AndroidRuntime(26242): at android.os.AsyncTask$3.done(AsyncTask.java:200) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask.setException(FutureTask.java:125) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308) ERROR/AndroidRuntime(26242): at java.util.concurrent.FutureTask.run(FutureTask.java:138) ERROR/AndroidRuntime(26242): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) ERROR/AndroidRuntime(26242): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) ERROR/AndroidRuntime(26242): at java.lang.Thread.run(Thread.java:1019) ERROR/AndroidRuntime(26242): Caused by: java.lang.IllegalStateException: Couldn't init cursor window ERROR/AndroidRuntime(26242): at android.database.CursorWindow.native_init(Native Method) ERROR/AndroidRuntime(26242): at android.database.CursorWindow.init(CursorWindow.java:41) ERROR/AndroidRuntime(26242): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:276) ERROR/AndroidRuntime(26242): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:268) ERROR/AndroidRuntime(26242): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171) ERROR/AndroidRuntime(26242): at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248) I can't seem to find much online about this and don't know what it really means. Regards, Julius. -- 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] Pain taking db reads off UI thread
Hi, I have been trying to take database reads off the UI thread and am currently using an AsyncTask, however I am running into trouble swapping out an updated Cursor for a new one in the adapter. (I was previously using requery() on the Cursor which had to be on the main UI thread) The documentation regarding requery() says: Just request a new cursor, so you can do this asynchronously and update your list view once the new cursor comes back. If I update the existing Cursor (mCursor) with the results from a new query and do the following in onPostExecute of an AsyncTask: mAdapter.changeCursor(mCursor); it works pretty well on a Nexus 1. On other devices I am getting errors because I haven't closed the old Cursor. (java/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor on null that has not been deactivated or closed) I have tried creating a new Cursor and swapping the Cursors out like so: if(null!=mArtists) mCursor.close(); mArtists = newCursor; but I get performance issues and the view of the list goes back to the top. Has anyone got any ideas on this? Alternatively does anyone have or know of any documentation for using a CursorLoader against a SQLiteDatabase rather than a ContentProvider? Thanks for any help. Regards, Julius. -- 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] Pain taking db reads off UI thread
Hi Dianne, Thank you for the reply. In this example I'm not sure what the baseUri should be : Uri baseUri; if (mCurFilter != null) { baseUri = Uri.withAppendedPath(Contacts.CONTENT_FILTER_URI, Uri.encode(mCurFilter)); } else { baseUri = Contacts.CONTENT_URI; } I have a SQLiteDatabase which I get usually access via a SQLiteOpenHelper. All the Loader examples I see refer to data stored as a ContentProvider. Regards, Julius. On 30/07/2011, at 6:04 AM, Dianne Hackborn wrote: Consider using loaders, for example: http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/LoaderCursorSupport.html On Fri, Jul 29, 2011 at 9:23 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I have been trying to take database reads off the UI thread and am currently using an AsyncTask, however I am running into trouble swapping out an updated Cursor for a new one in the adapter. (I was previously using requery() on the Cursor which had to be on the main UI thread) The documentation regarding requery() says: Just request a new cursor, so you can do this asynchronously and update your list view once the new cursor comes back. If I update the existing Cursor (mCursor) with the results from a new query and do the following in onPostExecute of an AsyncTask: mAdapter.changeCursor(mCursor); it works pretty well on a Nexus 1. On other devices I am getting errors because I haven't closed the old Cursor. (java/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor on null that has not been deactivated or closed) I have tried creating a new Cursor and swapping the Cursors out like so: if(null!=mArtists) mCursor.close(); mArtists = newCursor; but I get performance issues and the view of the list goes back to the top. Has anyone got any ideas on this? Alternatively does anyone have or know of any documentation for using a CursorLoader against a SQLiteDatabase rather than a ContentProvider? Thanks for any help. Regards, Julius. -- 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 -- 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 -- 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] Use CursorLoader for SQLiteDatabase?
Hi, I'm planning on going down the path of making a SQLiteLoader. The question I have is how do I access the LoaderManager. I have a ListActivity and have the compatibility library set up, but can't figure out how to initialise my loader. Regards, Julius. On 21/07/2011, at 5:10 AM, Mark Murphy wrote: On Wed, Jul 20, 2011 at 12:59 PM, Julius Spencer jul...@msa.co.nz wrote: The CursorLoader documentation describes itself as: A loader that queries the ContentResolver and returns a Cursor. Does anyone know if it's possible to use a CursorLoader for an application's SQLiteDatabase? It should be possible to use the Loader framework. CursorLoader is for content providers. We'd need a SQLiteLoader for a local database. Writing that is on my to-do list, before I cover loaders anywhere in my books. Not quite sure when I'm going to get around to that, though... Do I have to make the database a Content Provider so I can provide a Uri? If you wish to use CursorLoader, yes. If I do, can a Content Provider be private to the application (ie. not accessible to other applications on the device)? Yes. Make sure you have android:exported=false in the provider element -- by default, providers are exported. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | 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 -- 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] Use CursorLoader for SQLiteDatabase?
Hi, The CursorLoader documentation describes itself as: A loader that queries the ContentResolver and returns a Cursor. Does anyone know if it's possible to use a CursorLoader for an application's SQLiteDatabase? Do I have to make the database a Content Provider so I can provide a Uri? If I do, can a Content Provider be private to the application (ie. not accessible to other applications on the device)? The documentation for ContentProvider says: Content providers store and retrieve data and make it accessible to all applications. Thanks for any help! Regards, Julius. -- 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] Use CursorLoader for SQLiteDatabase?
Thank you for the reply I will let you know how I get on. On 21/07/2011, at 5:10 AM, Mark Murphy wrote: On Wed, Jul 20, 2011 at 12:59 PM, Julius Spencer jul...@msa.co.nz wrote: The CursorLoader documentation describes itself as: A loader that queries the ContentResolver and returns a Cursor. Does anyone know if it's possible to use a CursorLoader for an application's SQLiteDatabase? It should be possible to use the Loader framework. CursorLoader is for content providers. We'd need a SQLiteLoader for a local database. Writing that is on my to-do list, before I cover loaders anywhere in my books. Not quite sure when I'm going to get around to that, though... Do I have to make the database a Content Provider so I can provide a Uri? If you wish to use CursorLoader, yes. If I do, can a Content Provider be private to the application (ie. not accessible to other applications on the device)? Yes. Make sure you have android:exported=false in the provider element -- by default, providers are exported. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | 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 -- 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] MediaPlayer - mp3 audio stream Nexus Devices vs others
Hi, I am using the following to stream mp3 or m4a files from a server: mMediaPlayer.setOnCompletionListener(MyActivity.this); mMediaPlayer.setOnPreparedListener(MyActivity.this); mMediaPlayer.setOnErrorListener(MyActivity.this); mMediaPlayer.setDataSource(MyActivity.this,Uri.parse(mMediaURL)); //mMediaPlayer.setDataSource(mMediaURL); mMediaPlayer.prepareAsync(); This works fine on Nexus devices. Eg I get the following in the logcat and the music can be heard: INFO/StagefrightPlayer(68): setDataSource('http://media….') INFO/NuHTTPDataSource(68): connect to media…. @0 WARN/AudioFlinger(68): write blocked for 161 msecs, 67 delayed writes, thread 0xea00 However on other devices I get the following in logcat and no sound: VERBOSE/PlayerDriver(1233): Completed command PLAYER_HELPER status=PVMFSuccess VERBOSE/PVPlayer(1233): setDataSource(http://media) VERBOSE/PVPlayer(1233): prepareAsync VERBOSE/PVPlayer(1233): data source = http://media VERBOSE/PlayerDriver(1233): Send player code: 4 VERBOSE/PlayerDriver(1233): handleSetDataSource VERBOSE/PlayerDriver(1233): handleSetDataSource- scanning for extension VERBOSE/PlayerDriver(1233): CommandCompleted VERBOSE/PlayerDriver(1233): Completed command PLAYER_SET_DATA_SOURCE status=PVMFSuccess VERBOSE/PVPlayer(1233): run_init s=0, cancelled=0 VERBOSE/PlayerDriver(1233): Send player code: 7 VERBOSE/PlayerDriver(1233): headers size 0 VERBOSE/PlayerDriver(1233): release string is 2.2.2 len 5 INFO/CheckinTask(1573): Sending checkin request (1855 bytes) INFO/dalvikvm(1573): Jit: resizing JitTable from 8192 to 16384 VERBOSE/PlayerDriver(1233): HandleInformationalEvent: PVMFInfoContentType VERBOSE/PlayerDriver(1233): HandleInformationalEvent: PVMFInfoContentLength VERBOSE/PlayerDriver(1233): HandleInformationalEvent: PVMFInfoBufferingStart DEBUG/(1233): enter PVOMA1MOTRecognizerPlugin::Recognize DEBUG/(1233): enter PVGetInterface DEBUG/(1233): enter Instance DEBUG/(1233): enter SharedLibraryLookup DEBUG/(1233): enter GetFactoryAndMimeString DEBUG/(1233): PVMFCPMMotPlugInOMA1:SetSourceInitializationData in DEBUG/(1233): sourceURL is DEBUG/(1233): PVMFCPMMotPlugInOMA1:SetSourceInitializationData m_pvfile.Open failed VERBOSE/PlayerDriver(1233): HandleInformationalEvent: PVMFInfoErrorHandlingStart VERBOSE/PlayerDriver(1233): HandleInformationalEvent: type=26 UNHANDLED WARN/MediaPlayer(5088): info/warning (1, 26) INFO/MediaPlayer(5088): Info (1,26) DEBUG/(1233): enter SharedLibraryLookup DEBUG/(1233): enter GetFactoryAndMimeString INFO/WMDRMD(1233): unload libwmdrmdependency.so VERBOSE/PlayerDriver(1233): CommandCompleted VERBOSE/PlayerDriver(1233): Completed command PLAYER_INIT status=PVMFFailure ERROR/PlayerDriver(1233): Command PLAYER_INIT completed with an error or info PVMFFailure ERROR/MediaPlayer(5088): error (1, -1) ERROR/MediaPlayer(5088): Error (1,-1 Is there a way to get more debug or error information to find out what might be going wrong or what is different? My error listener just gives me a what and extra of 1 and -1. I have tried unsuccessfully on devices running 2.1 update 1 and 2.2.2. Thanks for any help. Regards, Julius. -- 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] Linkify combined with Html.fromHtml
Hi, I have a String with 'a href=...Something/a' tags and some text such as 'www.example.com'. I would like both to be links that can be clicked in a TextView. I can use Html.fromHtml to create links from the tags, but if I use Linkify.addLinks I lose the links created from the Html.fromHtml. mArticleTextView.setText(mDescription); mArticleTextView.setText(Html.fromHtml(mArticleTextView.getText().toString(), new MImageGetter(), null)); Linkify.addLinks(mArticleTextView, Linkify.ALL); Is there a way to get both to link in a TextView? Regards, Julius. -- 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] SearchRecentSuggestionsProvider for AutoCompleteTextView arrayadapter
Hi, I have set up a SearchRecentSuggestionsProvider to use with the Search Button which works well. I have an EditText in and Activity which I would like to change into an AutoCompleteTextView which would use the same suggestions. The AutoCompleteTextView example shows an ArrayAdapter with Strings array. Is it possible to bind up to the SearchRecentSuggestions? Regards, Julius. -- 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] HierarchyViewer on Nexus 1 HowTo
Hi, Does anyone know of a HowTo for getting HierarchyViewer going on a Nexus 1? So far I have unlocked the bootloader and rooted the device. From what I understand I next need to find a ROM which is suitable. (I'm still getting Unable to debug device errors) (I was told at IO that this is a useful tool but running the emulator in my environment isn't really practical) Regards, Julius. -- 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] Stack overflow
Wow, thank you everyone for the answers! I suspect the questions may be too niche which is why I'm not having much luck. Cheers, Julius. On 21/05/2011, at 10:51 PM, Mark Murphy wrote: On Fri, May 20, 2011 at 10:27 PM, Julius Spencer jul...@msa.co.nz wrote: After attending IO and talking to the engineers, I was told to put questions on stack overflow. I was wondering - how do I get people to look at these? Based on the last set of stats I ran, 83% of questions posted on StackOverflow in the android tag get at least one answer. 47% have an accepted answer, meaning that the person who posted the question agreed that an answer solved their problem. Not all people who ask questions accept answers, so the percentage of questions getting correct answers is probably somewhere in the 50-60% range, if I had to guess. As DanH indicates, question quality is one key determinant of success. The more information (e.g., stack traces, snippet of source showing where the crash occurred) you supply, the easier it will be for somebody to provide an answer. If your question pertains to subsystems beyond pure Android (e.g., SQLite, WebKit), tag the question for both android and the other piece of tech, to expose the question to more experts. Another thing that causes questions to go unanswered is if they're a bit too niche. The question may be perfectly valid, even exemplary, but if there aren't that many people who might know the answer, you'll have poor odds of one of them happening to try to answer your question. Similarly, StackOverflow, like this list, is best for SDK questions -- firmware questions tend not to fare as well. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- 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] Stack overflow
Hi, After attending IO and talking to the engineers, I was told to put questions on stack overflow. I was wondering - how do I get people to look at these? Regards, Julius. -- 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] Access the Activity stack
Hi, Just wondering, is it possible to look at an application's Activity stack? I'd like to be able to look at the stack and see if the previous Activity on the stack is the same as the one on the top. Regards, Julius. -- 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] onActivityResult in Activity in TabActivity
Hi, I am having trouble getting onActivityResult to run when I have an Activity finish. The situation is: Activity A (TabActivity) Activity B (Activity in Activity A) - set up in A like so: intent = new Intent().setClass(this, B.class); spec.setContent(intent); - starts Activity C like so: Intent i = new Intent(B.this, C.class); startActivityForResult(i, REQUEST_CODE); Activity C (separate Activity which setsResult and finishes) - finishes like so: Intent i = new Intent(); i.putExtra(EXTRA, id); setResult(RESULT_CODE, i); finish(); I can't seem to get onActivityResult to run in either A or B. I would have thought it would be in B, as the Intent in B to start Activity C gives itself as the context. although I'm guessing that this influences how onActivityResult works. Is this impossible or am I just missing something about how tabbed activities work like this? I guess I could go with views, but my tab Activity is going to start to get really long as well as the onActivityResult... :) On the other hand I just read that the Intent rather than View way of setting up TabActivities is not that efficient. (thanks MM) Any help would be greatly appreciated! Regards, Julius. -- 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] onActivityResult in Activity in TabActivity
Hi, After reading the documentation, the problem was that my REQUEST_CODE was negative so doesn't return a result. Ooops! Hope this helps someone else. Regards, Julius. On 3/04/2011, at 7:41 PM, Julius Spencer wrote: Hi, I am having trouble getting onActivityResult to run when I have an Activity finish. The situation is: Activity A (TabActivity) Activity B (Activity in Activity A) - set up in A like so: intent = new Intent().setClass(this, B.class); spec.setContent(intent); - starts Activity C like so: Intent i = new Intent(B.this, C.class); startActivityForResult(i, REQUEST_CODE); Activity C (separate Activity which setsResult and finishes) - finishes like so: Intent i = new Intent(); i.putExtra(EXTRA, id); setResult(RESULT_CODE, i); finish(); I can't seem to get onActivityResult to run in either A or B. I would have thought it would be in B, as the Intent in B to start Activity C gives itself as the context. although I'm guessing that this influences how onActivityResult works. Is this impossible or am I just missing something about how tabbed activities work like this? I guess I could go with views, but my tab Activity is going to start to get really long as well as the onActivityResult... :) On the other hand I just read that the Intent rather than View way of setting up TabActivities is not that efficient. (thanks MM) Any help would be greatly appreciated! Regards, Julius. -- 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] task affinity across devices
Hi, I have set up an application which uses task affinity to define two areas in an application. This is working really well on the Nexus 1 however I'm getting quite different experiences on other devices. For example, on the Dell Streak, the task affinity doesn't seem to have any effect at all on the stack - Activities just get layered on top of one another irrespective of task affinity. On the Nexus S, if the Home button is pressed and the user goes back into the application, a new Activity is placed on top of the stack of existing Activities that existed before selecting the Home button. Has anyone got some advice on this? Regards, Julius. -- 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] Two Activity Stacks
Hi, I've been trying to get this to work, but still have the problem when moving back to the original stack where a new Activity actually starts in the stack and I just wanted to resume the last Activity. I tried removing the Flag, but that didn't work. I could put a hack in with an Extra which finishes the Activity which is being started but I think I'm just doing something incorrect here. It's basically adding to the top of the stack when switching to the original stack rather than just showing the last Activity. Any ideas from anyone would be much appreciated. Regards, Julius. On 16/03/2011, at 10:43 AM, Julius Spencer wrote: Hi Dianne, Thank you for this. It's working well with one half of the application, but I'm having trouble with going back to the other half. For example: Area A Activities 1 2 3 4 5 Area B Activities 6 7 8 9 The application starts in Area A Activity 1. If I navigate to 6 = 7 = 8 = 1 = 2 then navigate to Area B I am at 8 which is perfect. However, when I try to go back to Area B, I end putting Activity 1 on the stack (so if I hit the back button I go back to 2). I was hoping I could simply group the Activities by using android:taskAffinity=.otherstuff alone but I'm probably misunderstanding the flag or setting up the Intent incorrectly. The intents I'm using (to move between Areas) are: (to go to Area B) i = new Intent(this, B.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); (to go to Area A) i = new Intent(this,A.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); I feel like it's really close and was wondering if you (or someone) can see where I might be going wrong. Regards, Julius. On 8/03/2011, at 11:40 AM, Dianne Hackborn wrote: Use android:taskAffinity to specify the affinity of activities in your second task. (For example android:taskAffinity=:otherstuff). When you want to switch between these tasks in your UI flow, use Intent.FLAG_ACTIVITY_NEW_TASK to switch to the other task. There are lots of subtleties you will get in to about what happens to the state of the task when you switch to it, since you are essentially becoming an app switcher at that point. On Mon, Mar 7, 2011 at 2:29 PM, Julius Spencer jul...@msa.co.nz wrote: Hi, I was wondering whether it's possible to have two Activity stacks in an application so if a user is using one part of an application and navigates to another area and then navigates back (without using the back button) to the original area he has the same history of Activities. Regards, Julius. -- 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 -- 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 -- 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] Two Activity Stacks
Hi Dianne, Thank you for this. It's working well with one half of the application, but I'm having trouble with going back to the other half. For example: Area A Activities 1 2 3 4 5 Area B Activities 6 7 8 9 The application starts in Area A Activity 1. If I navigate to 6 = 7 = 8 = 1 = 2 then navigate to Area B I am at 8 which is perfect. However, when I try to go back to Area B, I end putting Activity 1 on the stack (so if I hit the back button I go back to 2). I was hoping I could simply group the Activities by using android:taskAffinity=.otherstuff alone but I'm probably misunderstanding the flag or setting up the Intent incorrectly. The intents I'm using (to move between Areas) are: (to go to Area B) i = new Intent(this, B.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); (to go to Area A) i = new Intent(this,A.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(i); I feel like it's really close and was wondering if you (or someone) can see where I might be going wrong. Regards, Julius. On 8/03/2011, at 11:40 AM, Dianne Hackborn wrote: Use android:taskAffinity to specify the affinity of activities in your second task. (For example android:taskAffinity=:otherstuff). When you want to switch between these tasks in your UI flow, use Intent.FLAG_ACTIVITY_NEW_TASK to switch to the other task. There are lots of subtleties you will get in to about what happens to the state of the task when you switch to it, since you are essentially becoming an app switcher at that point. On Mon, Mar 7, 2011 at 2:29 PM, Julius Spencer jul...@msa.co.nz wrote: Hi, I was wondering whether it's possible to have two Activity stacks in an application so if a user is using one part of an application and navigates to another area and then navigates back (without using the back button) to the original area he has the same history of Activities. Regards, Julius. -- 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 -- 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] Two Activity Stacks
Hi, I was wondering whether it's possible to have two Activity stacks in an application so if a user is using one part of an application and navigates to another area and then navigates back (without using the back button) to the original area he has the same history of Activities. Regards, Julius. -- 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] Toast not disappearing
Hi Kostya, I'm not sure how to access the UI thread from within an IntentService. (If in an Activity I would use runOnUiThread) So far I have: private void showToastOnUIThread(final Toast toast) { handler.post(new Runnable() { @Override public void run() { toast.show(); } }); } The handler object is created in the IntentService. Thank you for the idea. Regards, Julius. On 1/03/2011, at 10:13 PM, Kostya Vasilyev wrote: Julius, You mentioned IntentService, which runs your code on a background thread. Even though Toast can supposedly be shown from any thread, I'd try changing the code so that you show the toast from the UI thread. That's easy to do with a Handler and a small Runnable subclass. -- Kostya 01.03.2011 10:06, Julius Spencer пишет: Unfortunately that didn't work. In on Destroy() I put in: System.out.println(Duration: +toastMessage.getDuration()); toastMessage.cancel(); (where toastMessage was assigned any toastMessage I'd created and shown) and I got: Duration: 0 Not sure if that is of any use. I've never had any trouble with Toasts (except not calling show() :) ). I'm a bit stumped. Regards, Julius. On 1/03/2011, at 7:50 PM, Julius Spencer wrote: Yeah it's definitely being hit just once (I put a break point in). I'll try out dismissing it if the IntentService is destroyed. Thanks for the replies everyone. Regards, Julius. On 1/03/2011, at 4:15 PM, TreKing wrote: On Mon, Feb 28, 2011 at 8:53 PM, Julius Spencerjul...@msa.co.nz wrote: I'm sure it's just something I'm not thinking of but I'm stumped... You're not calling it over and over again are you? - 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 -- Kostya Vasilyev -- 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 -- 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] Toast not disappearing
Hi, No unfortunately that didn't work. Thanks for the idea though. I think I'll use a notification instead (as it appears I probably should be). Cheers, Julius. On 2/03/2011, at 8:56 AM, Kostya Vasilyev wrote: Yes, that's pretty close to what I had in mind - assuming that the handler is created on the UI thread, such as inside the service's onCreate(). And I would marshal the message string, not the Toast object, so you don't even have to instantiate Toast objects in the worker thread. But the $64,000 question remains - did it help? -- Kostya 01.03.2011 22:43, Julius Spencer пишет: Hi Kostya, I'm not sure how to access the UI thread from within an IntentService. (If in an Activity I would use runOnUiThread) So far I have: private void showToastOnUIThread(final Toast toast) { handler.post(new Runnable() { @Override public void run() { toast.show(); } }); } The handler object is created in the IntentService. Thank you for the idea. Regards, Julius. On 1/03/2011, at 10:13 PM, Kostya Vasilyev wrote: Julius, You mentioned IntentService, which runs your code on a background thread. Even though Toast can supposedly be shown from any thread, I'd try changing the code so that you show the toast from the UI thread. That's easy to do with a Handler and a small Runnable subclass. -- Kostya 01.03.2011 10:06, Julius Spencer пишет: Unfortunately that didn't work. In on Destroy() I put in: System.out.println(Duration: +toastMessage.getDuration()); toastMessage.cancel(); (where toastMessage was assigned any toastMessage I'd created and shown) and I got: Duration: 0 Not sure if that is of any use. I've never had any trouble with Toasts (except not calling show() :) ). I'm a bit stumped. Regards, Julius. On 1/03/2011, at 7:50 PM, Julius Spencer wrote: Yeah it's definitely being hit just once (I put a break point in). I'll try out dismissing it if the IntentService is destroyed. Thanks for the replies everyone. Regards, Julius. On 1/03/2011, at 4:15 PM, TreKing wrote: On Mon, Feb 28, 2011 at 8:53 PM, Julius Spencerjul...@msa.co.nz wrote: I'm sure it's just something I'm not thinking of but I'm stumped... You're not calling it over and over again are you? - 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 -- Kostya Vasilyev -- 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 -- Kostya Vasilyev -- 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 -- 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] Toast not disappearing
Hi, I have an IntentService from which I am showing a Toast using: Toast.makeText(this, errorMessage.toString(), Toast.LENGTH_SHORT).show(); For some reason it's not disappearing. Just wondering if anyone has seen this before or knows what I'm doing wrong. I'm sure it's just something I'm not thinking of but I'm stumped... Thanks in advance. Regards, Julius. -- 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] Toast not disappearing
Yeah it's definitely being hit just once (I put a break point in). I'll try out dismissing it if the IntentService is destroyed. Thanks for the replies everyone. Regards, Julius. On 1/03/2011, at 4:15 PM, TreKing wrote: On Mon, Feb 28, 2011 at 8:53 PM, Julius Spencer jul...@msa.co.nz wrote: I'm sure it's just something I'm not thinking of but I'm stumped... You're not calling it over and over again are you? - 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 -- 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] Toast not disappearing
Unfortunately that didn't work. In on Destroy() I put in: System.out.println(Duration: +toastMessage.getDuration()); toastMessage.cancel(); (where toastMessage was assigned any toastMessage I'd created and shown) and I got: Duration: 0 Not sure if that is of any use. I've never had any trouble with Toasts (except not calling show() :) ). I'm a bit stumped. Regards, Julius. On 1/03/2011, at 7:50 PM, Julius Spencer wrote: Yeah it's definitely being hit just once (I put a break point in). I'll try out dismissing it if the IntentService is destroyed. Thanks for the replies everyone. Regards, Julius. On 1/03/2011, at 4:15 PM, TreKing wrote: On Mon, Feb 28, 2011 at 8:53 PM, Julius Spencer jul...@msa.co.nz wrote: I'm sure it's just something I'm not thinking of but I'm stumped... You're not calling it over and over again are you? - 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 -- 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] Concurrent database activity
Hi, I have an IntentService which syncs data from a server and takes a few minutes. The operation is database intensive locally (SQLite). I would like the user to be able to continue to use the application while the sync operation is going which involves the odd write to the database. Currently I'm getting database is locked errors. Has anyone come across this issue before and solved it? Regards, Julius. -- 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: Concurrent database activity
Hi Dan, Thanks for the reply. This sounds like something worth trying; would I store a boolean in the Application with synchronized accessors to determine whether a write operation is occurring and then put some kind of wait around write operations in a loop for the case where there is contention to keep trying until it is successful? I guess I'd just have to be careful where the operations were taking place that they were never on the main UI thread. Regards, Julius. On 12/02/2011, at 8:58 AM, DanH wrote: SQLite implements its own locking protocol internally. If you want operations to wait rather than fail, you need to wrap operations from both sources with your own synchronization primitives that wait rather than fail. On Feb 11, 1:34 pm, Julius Spencer jul...@msa.co.nz wrote: Hi, I have an IntentService which syncs data from a server and takes a few minutes. The operation is database intensive locally (SQLite). I would like the user to be able to continue to use the application while the sync operation is going which involves the odd write to the database. Currently I'm getting database is locked errors. Has anyone come across this issue before and solved it? Regards, Julius. -- 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
Re: [android-developers] Re: Concurrent database activity
Hi Dan, Thank you very much for your help - so far so good :) Regards, Julius. On 12/02/2011, at 2:23 PM, DanH wrote: Java has several synchronization primitives. Simplest would be to have all accesses synchronized on the same object, or you could use a Semaphore. Likely the DB is never tied up for more than a second or so, so there's not too much danger if you were to access from the main thread. On Feb 11, 5:35 pm, Julius Spencer jul...@msa.co.nz wrote: Hi Dan, Thanks for the reply. This sounds like something worth trying; would I store a boolean in the Application with synchronized accessors to determine whether a write operation is occurring and then put some kind of wait around write operations in a loop for the case where there is contention to keep trying until it is successful? I guess I'd just have to be careful where the operations were taking place that they were never on the main UI thread. Regards, Julius. On 12/02/2011, at 8:58 AM, DanH wrote: SQLite implements its own locking protocol internally. If you want operations to wait rather than fail, you need to wrap operations from both sources with your own synchronization primitives that wait rather than fail. On Feb 11, 1:34 pm, Julius Spencer jul...@msa.co.nz wrote: Hi, I have an IntentService which syncs data from a server and takes a few minutes. The operation is database intensive locally (SQLite). I would like the user to be able to continue to use the application while the sync operation is going which involves the odd write to the database. Currently I'm getting database is locked errors. Has anyone come across this issue before and solved it? Regards, Julius. -- 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 -- 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] Disable Auto-capitalization for EditText
Hi, I have a form which has an EditText and I would like to explicitly set the keyboard not to capitalize the first (or any) words. (I couldn't find an InputType which looked to do this) As an example if a user has the Swype keyboard installed and is using it with its Auto-capitalization option checked: how can I ensure that the keyboard won't open up with capital letter as the first letter when the EditText is selected? This is for a username / password form. Regards, Julius. -- 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: Capturing Intent.ACTION_MEDIA_SCANNER_FINISHED
On Dec 17 2010, 12:16 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Dec 15, 2010 at 7:47 PM, Julius Spencer jul...@msa.co.nz wrote: That was it; thank you again Mark. Do you know why it might not work in the manifest in this case (ie. for this Intent)? If you have not tried the corresponding data element, try that. Hi, This was the data element missing - thank you for pointing me in the right direction! Regards, Julius. -- 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: Disable Antenna
Thanks for the replies everyone - I would like to be able to have the phone only receive signals from a specific frequency which I can choose. I'm expecting it might require Beyond Java ( = commonsware reference) programming to make it happen. Appreciate the replies and any laughs at me or the question! :) Regards, Julius. On 6/01/2011, at 6:47 AM, Bob Kerns wrote: A screwdriver and an X-Acto knife. I doubt there's hardware support (or any need) for disabling antennas. Radios, yes, antennas, no. What are you trying to do? On Jan 5, 4:24 am, Mark Murphy mmur...@commonsware.com wrote: You do not have control over individual antennae via the SDK, AFAIK. On Wed, Jan 5, 2011 at 12:06 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I was wondering if it's possible to disable one or more antennae manually for example, if I had a GSM Nexus One, disable all the antennae except the one which supplies 850MHz communications (900 1800 1900). Regards, Julius. -- 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 _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.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] Disable Antenna
Hi, I was wondering if it's possible to disable one or more antennae manually for example, if I had a GSM Nexus One, disable all the antennae except the one which supplies 850MHz communications (900 1800 1900). Regards, Julius. -- 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] Opera callbacks
Oh yeah I meant the built in browser. Ah WebView os a great idea. Thank you. Regards, Julius. On 26/12/2010, at 10:56 AM, Mark Murphy wrote: I would recommend you try to find a way to use a WebView, for better control. Also, there is no Chrome in Android. I am assuming you are referring to the built-in browser (a.k.a., Browser). There is no documented and supported Intent pattern to force an Intent to go to the Browser app. On Fri, Dec 24, 2010 at 12:24 PM, Julius Spencer jul...@msa.co.nz wrote: Hi, I have an application that takes the user to a service provider's website to perform a login as part of an oauth process. Some users are having problems using Opera Mini. It seems like it can't handle the response call back scheme. Chrome works well so, I was wondering if it's possible to create an Intent which specifies Chrome. (or perhaps someone has come across this problem?) Regards, Julius. -- 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/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 2.2 Programming Books: http://commonsware.com/books -- 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] Opera callbacks
Hi, I have an application that takes the user to a service provider's website to perform a login as part of an oauth process. Some users are having problems using Opera Mini. It seems like it can't handle the response call back scheme. Chrome works well so, I was wondering if it's possible to create an Intent which specifies Chrome. (or perhaps someone has come across this problem?) Regards, Julius. -- 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] ContentObserver and BroadcastReceiver
Hi, (Note: might be a silly question...) I have an application which has data related to a ContentProvider. The ContentProvider's content is updated from time to time and a ContentObserver seems like a good choice to know about these updates. Is there a way to have a have a cross between a ContentObserver and a BroadcastReceiver so that the application doesn't need to be running and yet when content is updated a broadcast is created? Regards, Julius. -- 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] ContentObserver and BroadcastReceiver
Ah ok, thanks for the reply. Regards, Julius. On 20/12/2010, at 3:58 PM, Dianne Hackborn wrote: No there isn't. This is deliberate, as having apps suddenly getting launched left and right as syncs happen in the background stuff is likely to lead to an undesirable outcome. The approach we generally take is that in cases where there is some kind of change that may happen that an app may reasonably be launched for, defining a specific broadcast for that that the content provider sends at that point. For example there is a broadcast the gmail provider sense when new mail has arrived. On Sun, Dec 19, 2010 at 6:23 PM, Julius Spencer jul...@msa.co.nz wrote: Hi, (Note: might be a silly question...) I have an application which has data related to a ContentProvider. The ContentProvider's content is updated from time to time and a ContentObserver seems like a good choice to know about these updates. Is there a way to have a have a cross between a ContentObserver and a BroadcastReceiver so that the application doesn't need to be running and yet when content is updated a broadcast is created? Regards, Julius. -- 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 -- 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 -- 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] Capturing Intent.ACTION_MEDIA_SCANNER_FINISHED
Hi, I have set up a BroadcastReceiver to capture: Intent.ACTION_MEDIA_SCANNER_FINISHED or: android.intent.action.MEDIA_SCANNER_FINISHED and I'm not able to capture the Intent. I have tried using the Manifest as well as programmatically, without any luck: receiver android:name=.MediaScannerFinishedReceiver intent-filter action android:name=android.intent.action.MEDIA_SCANNER_FINISHED/ /intent-filter /receiver or: public void registerMediaScannerListener() { if (mMediaScannerReceiver == null) { mMediaScannerReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(Intent.ACTION_MEDIA_SCANNER_FINISHED)) { System.out.println(I'm here!); } } }; IntentFilter iFilter = new IntentFilter(); iFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); registerReceiver(mMediaScannerReceiver, iFilter); } } Has anyone tried this - is there a permission or something I need to capture this? Thank you for any help! Regards, Julius. Regards, Julius Spencer. jul...@msa.co.nz Ph: 0064 9 307 1089 Fax: 0064 9 307 5281 Mobile: 0064 21 72 5559 -- 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] Capturing Intent.ACTION_MEDIA_SCANNER_FINISHED
That was it; thank you again Mark. Do you know why it might not work in the manifest in this case (ie. for this Intent)? Regards, Julius. On 16/12/2010, at 1:40 PM, Mark Murphy wrote: If the source code is any indicator, you need: intentFilter.addDataScheme(file); or the data equivalent in addition to what you have there. For example: IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_SCANNER_FINISHED); intentFilter.addDataScheme(file); registerReceiver(mReceiver, intentFilter); On Wed, Dec 15, 2010 at 7:17 PM, Julius Spencer jul...@msa.co.nz wrote: Hi, I have set up a BroadcastReceiver to capture: Intent.ACTION_MEDIA_SCANNER_FINISHED or: android.intent.action.MEDIA_SCANNER_FINISHED and I'm not able to capture the Intent. I have tried using the Manifest as well as programmatically, without any luck: receiver android:name=.MediaScannerFinishedReceiver intent-filter action android:name=android.intent.action.MEDIA_SCANNER_FINISHED/ /intent-filter /receiver or: public void registerMediaScannerListener() { if (mMediaScannerReceiver == null) { mMediaScannerReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(Intent.ACTION_MEDIA_SCANNER_FINISHED)) { System.out.println(I'm here!); } } }; IntentFilter iFilter = new IntentFilter(); iFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); registerReceiver(mMediaScannerReceiver, iFilter); } } Has anyone tried this - is there a permission or something I need to capture this? Thank you for any help! Regards, Julius. Regards, Julius Spencer. jul...@msa.co.nz Ph: 0064 9 307 1089 Fax: 0064 9 307 5281 Mobile: 0064 21 72 5559 -- 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/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.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] Accessing Video Thumbnail
Hi, I got this working in the end using the advice here: http://www.mail-archive.com/android-developers@googlegroups.com/msg24164.html Part of the problem was that I was looking for the wrong media type or more correctly, I was telling the scanner it was of a different mime type so it wasn't showing when I searched for it. Hope that helps someone... Cheers, Julius. On 25/11/2010, at 8:26 AM, Julius Spencer wrote: Hi, I am having trouble getting a thumbnail for a video. I am targeting 2.1 update 1. (API level 7) I would like to use MediaStore.Video.Thumbnails.getThumbnail. This works perfectly if the SD Card has been mounted / unmounted. However, when a video is first created I would like it to be scanned (by the MediaScanner I believe) so it is indexed and I can show a preview immediately using the getThumbnail method. Looking at the source I suspect this is a device specific class. I have tried creating a class that implements MediaScannerConnectionClient but onScanCompleted never seems to get called. Has anyone had any success making thumbnails like this? Any direction would be really helpful :) Regards, Julius. -- 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] Accessing Video Thumbnail
Hi, I am having trouble getting a thumbnail for a video. I am targeting 2.1 update 1. (API level 7) I would like to use MediaStore.Video.Thumbnails.getThumbnail. This works perfectly if the SD Card has been mounted / unmounted. However, when a video is first created I would like it to be scanned (by the MediaScanner I believe) so it is indexed and I can show a preview immediately using the getThumbnail method. Looking at the source I suspect this is a device specific class. I have tried creating a class that implements MediaScannerConnectionClient but onScanCompleted never seems to get called. Has anyone had any success making thumbnails like this? Any direction would be really helpful :) Regards, Julius. -- 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] GridView disappears...
Hi, I have a smooth scrolling gridview populated with thumbnails of images (in portrait and landscape) and when scrolling sometimes the girdview disappears of the top or bottom of the screen. It sounds like this problem here: http://stackoverflow.com/questions/2947019/scrolling-issues-with-gridview-in-android There don't appear to be any Error or Warning Logs created when it occurs. Has anyone seen this before or have an idea of what I have done wrong? (I'm guessing that each row in the GridView is calculated at some point and when there is a portrait image and a landscape image in a row the height of the GrdiView is calculated incorrectly) Regards, Julius. Regards, Julius Spencer. jul...@msa.co.nz Ph: 0064 9 307 1089 Fax: 0064 9 307 5281 Mobile: 0064 21 72 5559 -- 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] Get View's siblings
Thank that has sorta worked. I used getChildAt(int x); On 7/11/2010, at 6:52 PM, Sarava Kumar wrote: 1. store those each two elements inside single parent such as LinearLayout 2. you can get that ImageView's parent node by calling is getParent like method 3. then get those parent's(LinearLayout) second child by getChild(1).. I hope this help you... On Sun, Nov 7, 2010 at 11:18 AM, Kumar Bibek coomar@gmail.com wrote: You can first get the parent of the ImageView and then get whichever child you want. But, I am not sure if you can get it directly. On Sun, Nov 7, 2010 at 11:15 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I have a layout that includes an ImageView and a CheckBox and I am implementing onClick for the ImageView. I would like to alter the state of the CheckBox when the ImageView is 'clicked'. The state I am storing fine, but I would like the CheckBox to change. Is there a way I can get access to the ImageView's siblings (in this case there would be one; the CheckBox)? Regards, Julius. -- 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 -- Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.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 -- 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] Get View's siblings
Hi, I have a layout that includes an ImageView and a CheckBox and I am implementing onClick for the ImageView. I would like to alter the state of the CheckBox when the ImageView is 'clicked'. The state I am storing fine, but I would like the CheckBox to change. Is there a way I can get access to the ImageView's siblings (in this case there would be one; the CheckBox)? Regards, Julius. -- 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] IllegalStateException: No wrapped connection.
Hi, I'm trying to send an HTTP request from a WakefulService so a Service which has been started from an alarm set up with AlarmManager and I get the error: IllegalStateException: No wrapped connection. HttpGet httpGet = (HttpGet) new HttpGet(MYRequestHelper.getRequest(this)); HttpClient client = ((MYApplication) getApplication()).getHttpClient(); String response; try { response = client.execute(httpGet, new BasicResponseHandler()); At this point I run through parsing JSON and creating new HttpGets and executing them on the client. Is it possible I running execute too many times on the client or something? I'm don't really understand what the error means and I haven't been able to glean anything much from Googling other than to catch it and hope for the best. Cheers, Julius. -- 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] IllegalStateException: No wrapped connection.
Wow thank you Mark. I'll try to implement those changes. Regards, Julius. On 31/10/2010, at 7:56 PM, Mark Murphy wrote: There is something messed up with your HttpClient object. That exception is being raised by HttpClient itself, based upon what I can see in the Android source code. Bear in mind that, in the case of an alarm, your process hopefully was terminated/recycled since the last alarm, and so there is little value in attempting to reuse some global HttpClient here. I'd just create a new one. Also, bear in mind that all IntentServices do their work on a background thread, and HttpClient is not thread-safe by default. It's possible this error is tied to that. You need to hook up a ThreadSafeClientConnManager to the HttpClient object if you will reuse it across multiple threads. On Sun, Oct 31, 2010 at 2:14 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I'm trying to send an HTTP request from a WakefulService so a Service which has been started from an alarm set up with AlarmManager and I get the error: IllegalStateException: No wrapped connection. HttpGet httpGet = (HttpGet) new HttpGet(MYRequestHelper.getRequest(this)); HttpClient client = ((MYApplication) getApplication()).getHttpClient(); String response; try { response = client.execute(httpGet, new BasicResponseHandler()); At this point I run through parsing JSON and creating new HttpGets and executing them on the client. Is it possible I running execute too many times on the client or something? I'm don't really understand what the error means and I haven't been able to glean anything much from Googling other than to catch it and hope for the best. Cheers, Julius. -- 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/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 2.2 Programming Books: http://commonsware.com/books -- 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
Re: [android-developers] IllegalStateException: No wrapped connection.
Hi Mark, Looks like it was a threading issue - from what you say; IntentService doing work on a separate thread, so just creating a new DefaultHttpClient seems to have done the trick. Thank you for explaining (once again) :) Regards, Julius. On 31/10/2010, at 7:56 PM, Mark Murphy wrote: There is something messed up with your HttpClient object. That exception is being raised by HttpClient itself, based upon what I can see in the Android source code. Bear in mind that, in the case of an alarm, your process hopefully was terminated/recycled since the last alarm, and so there is little value in attempting to reuse some global HttpClient here. I'd just create a new one. Also, bear in mind that all IntentServices do their work on a background thread, and HttpClient is not thread-safe by default. It's possible this error is tied to that. You need to hook up a ThreadSafeClientConnManager to the HttpClient object if you will reuse it across multiple threads. On Sun, Oct 31, 2010 at 2:14 AM, Julius Spencer jul...@msa.co.nz wrote: Hi, I'm trying to send an HTTP request from a WakefulService so a Service which has been started from an alarm set up with AlarmManager and I get the error: IllegalStateException: No wrapped connection. HttpGet httpGet = (HttpGet) new HttpGet(MYRequestHelper.getRequest(this)); HttpClient client = ((MYApplication) getApplication()).getHttpClient(); String response; try { response = client.execute(httpGet, new BasicResponseHandler()); At this point I run through parsing JSON and creating new HttpGets and executing them on the client. Is it possible I running execute too many times on the client or something? I'm don't really understand what the error means and I haven't been able to glean anything much from Googling other than to catch it and hope for the best. Cheers, Julius. -- 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/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 2.2 Programming Books: http://commonsware.com/books -- 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] setSpeakerPhoneOn
Hi, I'm trying to figure out how to set the speaker phone to on when the phone call state changes. I have something like the following: class TelephoneListener extends PhoneStateListener { public void onCallStateChanged(int state, String incomingNumber) { super.onCallStateChanged(state, incomingNumber); switch (state) { case TelephonyManager.CALL_STATE_OFFHOOK: //CALL_STATE_OFFHOOK; // Set audio to 0 and remove sound and vibrate AudioManager mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE); mAudioManager.setSpeakerphoneOn(true); I was wondering if this is possible or not. I don't have any errors, but I don't have any joy either... I have searched for setSpeakerPhoneOn and haven't come up with anything other than permissions which I have set up in my Manifest. Cheers, Julius. -- 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: Testing C2DM service on Android 2.2 emulator
Hi, I have the same problem - not quite sure what I'm doing wrong. I'd like to use the emulator to be able to check the networking. Perhaps my c2dm account isn't really set up yet. Regards, Julius. On Sep 10, 9:08 pm, Hatch tomislav.hecimo...@gmail.com wrote: Been trying for ages (at least, so it seems) I am using Google APIs 8,rev2. Keep getting the same result. Something just isn't geting digested in the auth layer :( Any tips ? (scenario: simple c2dm registration - failing, chrome to phone - working ok !) Regards, Hatch On Aug 19, 12:15 pm, xianhao lv xianhao...@gmail.com wrote: Try Google APIs by Google Inc., Android API 8, revision2 if SDK api8 revision 2 doesn't work. On Thu, Aug 19, 2010 at 6:09 PM, xianhao lv xianhao...@gmail.com wrote: Maybe you should use SDK platform Android 2.2 API 8 revision 2 to have a try. But I got the following errors: 8-19 09:56:08.777: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.557: WARN/DefaultRequestDirector(171): Authentication error: Unable to respond to any of these challenges: {} 08-19 09:56:10.557: DEBUG/C2DMRegistrar(171): [C2DMRegistrar.22] register: http error 401 08-19 09:56:10.557: ERROR/C2DMRegistrar(171): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException 08-19 09:56:10.647: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.967: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:36.147: WARN/DeviceRegistrar(275): Registration error Read error: Failure in SSL library, usually a protocol error On Thu, Aug 12, 2010 at 4:24 AM, Mark Murphy mmur...@commonsware.comwrote: Make sure you have set up a Google account in the emulator (Settings Accounts). On Wed, Aug 11, 2010 at 4:00 PM, Sean Liao wirelessw...@gmail.com wrote: I am having the same problem ... any solution or any pointer? On Tue, Jul 6, 2010 at 9:59 AM, guligo igors.gulbins...@gmail.com wrote: Hi guys, I am playing around with C2DM service. What I am concerned about is that I cannot test my device-side application from Android 2.2 emulator. The application was built more or less according to http://code.google.com/android/c2dm/index.htmldoc, but when register intent is sent from application, Logcat shows this: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found I also tried to run chrometophone and jumpnote applications and the result is the same when registring device. Any ideas? ...main question probably - is it possible to test C2DM service from Android emulator? 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.comandroid-developers%2Bunsubs cr...@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.comandroid-developers%2Bunsubs cr...@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 Android 2.2 Programming Books:http://commonsware.com/books -- 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 -- 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: Testing C2DM service on Android 2.2 emulator
Hi, Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found Oh maybe this can't be done in the emulator: To develop and debug on an actual device, you need a device running an Android 2.2 system image that includes the Market application. I don't have Market in the emulator. If this is why I can't do this, it would be great to know. Cheers, Julius. On 12/09/2010, at 6:48 PM, julius wrote: Hi, I have the same problem - not quite sure what I'm doing wrong. I'd like to use the emulator to be able to check the networking. Perhaps my c2dm account isn't really set up yet. Regards, Julius. On Sep 10, 9:08 pm, Hatch tomislav.hecimo...@gmail.com wrote: Been trying for ages (at least, so it seems) I am using Google APIs 8,rev2. Keep getting the same result. Something just isn't geting digested in the auth layer :( Any tips ? (scenario: simple c2dm registration - failing, chrome to phone - working ok !) Regards, Hatch On Aug 19, 12:15 pm, xianhao lv xianhao...@gmail.com wrote: Try Google APIs by Google Inc., Android API 8, revision2 if SDK api8 revision 2 doesn't work. On Thu, Aug 19, 2010 at 6:09 PM, xianhao lv xianhao...@gmail.com wrote: Maybe you should use SDK platform Android 2.2 API 8 revision 2 to have a try. But I got the following errors: 8-19 09:56:08.777: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.557: WARN/DefaultRequestDirector(171): Authentication error: Unable to respond to any of these challenges: {} 08-19 09:56:10.557: DEBUG/C2DMRegistrar(171): [C2DMRegistrar.22] register: http error 401 08-19 09:56:10.557: ERROR/C2DMRegistrar(171): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException 08-19 09:56:10.647: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.967: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:36.147: WARN/DeviceRegistrar(275): Registration error Read error: Failure in SSL library, usually a protocol error On Thu, Aug 12, 2010 at 4:24 AM, Mark Murphy mmur...@commonsware.comwrote: Make sure you have set up a Google account in the emulator (Settings Accounts). On Wed, Aug 11, 2010 at 4:00 PM, Sean Liao wirelessw...@gmail.com wrote: I am having the same problem ... any solution or any pointer? On Tue, Jul 6, 2010 at 9:59 AM, guligo igors.gulbins...@gmail.com wrote: Hi guys, I am playing around with C2DM service. What I am concerned about is that I cannot test my device-side application from Android 2.2 emulator. The application was built more or less according to http://code.google.com/android/c2dm/index.htmldoc, but when register intent is sent from application, Logcat shows this: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found I also tried to run chrometophone and jumpnote applications and the result is the same when registring device. Any ideas? ...main question probably - is it possible to test C2DM service from Android emulator? 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.comandroid-developers%2Bunsubs cr...@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.comandroid-developers%2Bunsubs cr...@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 Android 2.2 Programming Books:http://commonsware.com/books -- 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 -- You received this message because you are subscribed to the Google
Re: [android-developers] Re: Testing C2DM service on Android 2.2 emulator
Uh disregard that I didn't see the next bit: To develop and test on the Android Emulator, you need to download the Android 2.2 version of the Google APIs Add-On into your SDK using the Android SDK and AVD Manager. Specifically, you need to download the component named Google APIs by Google Inc, Android API 8. Then, you need to set up an AVD that uses that system image. On 12/09/2010, at 7:30 PM, Julius Spencer wrote: Hi, Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found Oh maybe this can't be done in the emulator: To develop and debug on an actual device, you need a device running an Android 2.2 system image that includes the Market application. I don't have Market in the emulator. If this is why I can't do this, it would be great to know. Cheers, Julius. On 12/09/2010, at 6:48 PM, julius wrote: Hi, I have the same problem - not quite sure what I'm doing wrong. I'd like to use the emulator to be able to check the networking. Perhaps my c2dm account isn't really set up yet. Regards, Julius. On Sep 10, 9:08 pm, Hatch tomislav.hecimo...@gmail.com wrote: Been trying for ages (at least, so it seems) I am using Google APIs 8,rev2. Keep getting the same result. Something just isn't geting digested in the auth layer :( Any tips ? (scenario: simple c2dm registration - failing, chrome to phone - working ok !) Regards, Hatch On Aug 19, 12:15 pm, xianhao lv xianhao...@gmail.com wrote: Try Google APIs by Google Inc., Android API 8, revision2 if SDK api8 revision 2 doesn't work. On Thu, Aug 19, 2010 at 6:09 PM, xianhao lv xianhao...@gmail.com wrote: Maybe you should use SDK platform Android 2.2 API 8 revision 2 to have a try. But I got the following errors: 8-19 09:56:08.777: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.557: WARN/DefaultRequestDirector(171): Authentication error: Unable to respond to any of these challenges: {} 08-19 09:56:10.557: DEBUG/C2DMRegistrar(171): [C2DMRegistrar.22] register: http error 401 08-19 09:56:10.557: ERROR/C2DMRegistrar(171): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException 08-19 09:56:10.647: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:10.967: DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService } 08-19 09:56:36.147: WARN/DeviceRegistrar(275): Registration error Read error: Failure in SSL library, usually a protocol error On Thu, Aug 12, 2010 at 4:24 AM, Mark Murphy mmur...@commonsware.comwrote: Make sure you have set up a Google account in the emulator (Settings Accounts). On Wed, Aug 11, 2010 at 4:00 PM, Sean Liao wirelessw...@gmail.com wrote: I am having the same problem ... any solution or any pointer? On Tue, Jul 6, 2010 at 9:59 AM, guligo igors.gulbins...@gmail.com wrote: Hi guys, I am playing around with C2DM service. What I am concerned about is that I cannot test my device-side application from Android 2.2 emulator. The application was built more or less according to http://code.google.com/android/c2dm/index.htmldoc, but when register intent is sent from application, Logcat shows this: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found I also tried to run chrometophone and jumpnote applications and the result is the same when registring device. Any ideas? ...main question probably - is it possible to test C2DM service from Android emulator? 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.comandroid-developers%2Bunsubs cr...@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.comandroid-developers%2Bunsubs cr...@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 Android 2.2 Programming Books:http://commonsware.com/books -- You received this message because you are subscribed
[android-developers] C2DM debugging
Hi, I have set up a project to use C2DM and am having trouble getting the registration process working. I have the project debugging on the emulator so I can run Wireshark on my development computer to see the packets. It appears there is traffic between the emulator and Google's servers, but I can't tell what is coming back (it's all in https). I think I have the manifest set up correctly for the BroadcastReceiver although I am not seeing anything come through (I have breakpoints in the BroadcastReceiver). I have the service configured: service android:name=.XXC2DMBroadcastReceiver / and the permissions and receiver: permission android:name=xxx.permission.C2D_MESSAGE android:protectionLevel=signature / uses-permission android:name=xxx.permission.C2D_MESSAGE / !-- This app has permission to register and receive message -- uses-permission android:name=com.google.android.c2dm.permission.RECEIVE / !-- Send the registration id to the server -- uses-permission android:name=android.permission.INTERNET / uses-permission android:name=android.permission.WAKE_LOCK/ !-- Only C2DM servers can send messages for the app. If permission is not set - any other app can generate it -- receiver android:name=com.google.android.c2dm.C2DMBroadcastReceiver android:permission=com.google.android.c2dm.permission.SEND !-- Receive the actual message -- intent-filter action android:name=com.google.android.c2dm.intent.RECEIVE / category android:name=xxx / /intent-filter !-- Receive the registration id -- intent-filter action android:name=com.google.android.c2dm.intent.REGISTRATION / category android:name=xxx / /intent-filter /receiver uses-sdk android:minSdkVersion=8 / As an aside I have set up the account with Google for the service and have an Auth key. Does anyone have any tips as to what I might be able to do, to see where I might be going wrong (or maybe can see what I've done wrong in the manifest)? Regards, Julius. -- 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 there a way to request permissions from a user as you need them?
Ideally, as a user, I would like to: 1. Have app developers be able to note specifically what each permission they are requesting is for. 2. On install, have the ability to 'uncheck' any permission that I don't feel comfortable with (otherwise would install with default requested permissions). Stats on which permissions users allow could be sent to developers to give further guidance on what their user base finds acceptable. 3. Give apps the ability to let you know if they are not able to do a certain task because of permission settings (with the ability to don't show this again). 4. Be able to change permissions from the 'Application Info' page when managing applications. 5. Have an Application Permissions menu under 'Application settings' which would allow you to see applications installed by permission type. For example you could select Your location and it would show all the applications that have that permission granted. Clicking on an application from that list would bring you to its Application info page where you could change the permission settings. I didn't really give permissions much thought until a friend of mine who switched to Android from Blackberry expressed his frustration with this. Although I don't have first hand experience, RIM does allow for granular control of application permissions. I may be a technically inclined user, but I don't think I am an outlier. -- 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] Styling text with internationalisation
Hi, I have some text which I would like to style with colour, for example: I jump in the red bus. I would like red to be in red so I'm using: SpannableStringBuilder This works really nicely - but I'm guessing that if I want to put red into another language, especially one which uses cases, this will become a problem. By case, I mean the word red might change its spelling based on its use (maybe it has the preposition in tacked on the end of red or maybe there is an ending signifying that in is accusative rather than dative (maybe I'm jumping within the bus rather than moving into it from outside the bus)). Is there a standard way to deal with styling text based on different languages? Regards, Julius. -- 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] Deep sleep behaviour
Hi, I'm a bit new to the deep sleep behaviour in Android and am having trouble replicating it. (If I have any device connected to my computer for debugging I'm not seeing the deep sleep) I am guessing that it is affecting an application which I am writing. The application has a countdown which I have been using a service with a Handler and postAtTime to decrement the counter. I suspect that deep sleep is pausing the counter so I think I will move to using AlarmManager to have things occur at certain times. What I was wondering was, during deep sleep, if I have a service which listens to the acceleration and the battery state, will these still work when the phone is in deep sleep? Also, is there a way to induce deep sleep? (so I can perform testing) Thanks for any help! Regards, Julius. -- 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] Deep sleep behaviour
Hi Mark, Thank you for the reply. Accelerometers used to, but no longer, if I understand correctly. I'll be fairly stunned if ACTION_BATTERY_LOW will be fired when the CPU is otherwise off. Let's say I wanted to have the device not go into a deep sleep for say 60 minutes - is there a way I could make this happen? This is the kind of situation where the user would want this to happen. op touching the device for a while, and have it untethered. Ok so I guess I'll have to debug using System.out.println or Log.i or something. Regards, Julius. -- 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: Problem computing the free space on the external card - only with a single installation
Hi, I have this same issue; my check evaluates available space as negative in rare cases. I'm not sure yet whether I can take an absolute value. This must be a problem which has happened before. Anyone else come across this? Regards, Julius. On 16/08/2010, at 7:52 AM, Bob Kerns wrote: Two possibilities come to mind. First, perhaps the Dell Streak is one of the phones that has more than one set of SD storage, and mounts the true external one on a subirectory under getExternalStorageDirectory(). But the more likely possibility is that the phone has the problem that this reviewer observed, with the storage sometimes not being seen: http://ptech.allthingsd.com/20100811/dells-streak-a-tiny-tablet-that-takes-calls-too/ That would seem to fit the symptoms better -- sometimes it working, sometimes not. On Aug 15, 12:59 am, Fabrizio Giudici fabrizio.giud...@tidalwave.it wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello. My application allow to download files and store them on the external card. To avoid filling it, I've implemented a safety check so it prevents downloading when the free space is less than 20MB. The computation of the free space is done by: public synchronized long getFreeSpace() { if (statFs == null) { statFs = new StatFs(getExternalStorageDirectory().getAbsolutePath()); } return statFs.getAvailableBlocks() * statFs.getBlockSize(); } which I presume is correct. In fact, it works in all my tests and for what I can say for the 99% of users. But a single user notified me that my app is constantly giving the card full message, as if the above method didn't work. He also told me that the problem went away after a while, and returned after upgrading a new release of my app. The user seems an advanced one, and I think he's able to check and correctly manage the contents of his external card. He reported that the card has more than 1.4GB free on the card. Are you aware of any specific issue or bug? The smartphone of the user is a Dell Streak with Android 1.6. Thanks. - -- Fabrizio Giudici - Java Architect, Project Manager Tidalwave s.a.s. - We make Java work. Everywhere. java.net/blog/fabriziogiudici -www.tidalwave.it/people fabrizio.giud...@tidalwave.it -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/ iEYEARECAAYFAkxnnlYACgkQeDweFqgUGxcjjACgqoLP3HiHB5r8lsQytu/59Xdb bE8An1t/mt2gKIdisyZc1sI3/lGHp8dh =dZLt -END PGP SIGNATURE- -- 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
Re: [android-developers] Re: Problem computing the free space on the external card - only with a single installation
Oops! Thank you Kostya! On 19/08/2010, at 8:37 AM, Kostya Vasilyev wrote: The code above multiplies two ints and casts them to long. If the intermediate result is over 2Gb, you'll get a negative number. Try multiplying long values instead: long byteCount = blockSize * (long) avlBlocks; -- Kostya Vasilyev -- http://kmansoft.wordpress.com 19.08.2010 0:09 пользователь Julius Spencer jul...@msa.co.nz написал: Hi, I have this same issue; my check evaluates available space as negative in rare cases. I'm not sure yet whether I can take an absolute value. This must be a problem which has happened before. Anyone else come across this? Regards, Julius. On 16/08/2010, at 7:52 AM, Bob Kerns wrote: Two possibilities come to mind. First, perhaps... -- 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
Re: [android-developers] Re: KEYCODE_HOME
Hi, Just wanted to check this is still the case. I have a situation where someone wants an application not exit, if the power or home keys are pressed. (They'd like the application to be exited via a password or PIN) I'm guessing there is no other work around... Regards, Julius. On 11/08/2009, at 3:20 PM, Dianne Hackborn wrote: The home and end call keys are intercepted by the system before ever reaching the application, and there is nothing you can do in the app to modify their behavior (including overriding onKeyDown). All other keys (including back, menu, call, and search) are first sent to the application and only perform their default action if the application does not consume them. By returning true from onKeyDown(), you are consuming the events and not allowing their normal behavior to run. On Mon, Aug 10, 2009 at 7:15 PM, eags eagsala...@gmail.com wrote: This behavior is actually very strange and apparently not quite as simple as the event is not delivered to applications. Indeed if I try and capture the key event, I cannot. However if I just do this: public boolean onKeyDown(int keyCode, KeyEvent event) { return true; //return super.onKeyDown(keyCode, event); } and then press the home key, the Activity does not stay in the task stack and launching again does not get me back to this activity but the whole app is just launched again from the beginning. So it is like there is something in the default implementation of onKeyDown that makes the correct behavior work and I can't stop it from happening but somehow I can break it but always retuning true from onKeyDown. Can anyone explain this behavior or point me to some documentation that will clear this up? Thanks. On Aug 7, 8:04 pm, Marco Nelissen marc...@android.com wrote: The home key is not delivered to applications. On Fri, Aug 7, 2009 at 7:25 PM, eagseagsala...@gmail.com wrote: I have implemented onKeyDown and can successfully intercept KEYCODE_BACK and many others to prohibit the default behavior. Is this not possible with KEYCODE_HOME? I have a test activity that will only finish() if KEYCODE_A is seen. Even KEYCODE_BACK does nothing. However KEYCODE_HOME continues to have its effect. Anyone have any insight into this? Thanks. The test code is below. The strange thing to note is that although the toast in the if/else that should handle the KEYCODE_HOME never fires, if I relaunch the application the state is *not* restored so it is like either the onDestroy is being called (previously I tried finish() also) or it is like the application is crashing for some other reason. I'm confused. import android.app.Activity; import android.os.Bundle; import android.view.KeyEvent; import android.widget.Toast; public class MainMenu extends Activity { public void onCreate(Bundle bun) { super.onCreate(bun); setContentView(R.layout.main); } public boolean onKeyDown(int keyCode, KeyEvent event) { //if we get any key, clear the Splash Screen if(keyCode==KeyEvent.KEYCODE_HOME) { Toast.makeText(getApplicationContext(), HIT!, Toast.LENGTH_SHORT).show(); onDestroy(); return true; } else { Toast.makeText(getApplicationContext(), missed, Toast.LENGTH_SHORT).show(); return true; } //return super.onKeyDown(keyCode, event); } } -- 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 -~--~~~~--~~--~--~--- -- 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: Get all text (including encoded) from XML Text Node
Not sure - I just put the data back together. It didn't appear to be that expensive. On 4/07/2010, at 6:14 AM, Bob Kerns wrote: I'm a little puzzled by this behavior. This is supposed to be controlled by this: http://developer.android.com/intl/de/reference/javax/xml/parsers/DocumentBuilderFactory.html#setExpandEntityReferences(boolean) which is supposed to default to true. On Jul 2, 8:06 pm, Julius Spencer jul...@msa.co.nz wrote: On closer inspection the index part I have misinterpreted - the whole string might be broken into parts eg. Text node j EntityReference node ó Text node bb Regards, Julius. (on closer inspection zees are loafers) On 3/07/2010, at 2:47 PM, Julius Spencer wrote: Hi, Thank you for the reply. Something's not right. Although I have no experience with DocumentBuilder, (ask me a SAXParser question, please!) I'm starting to think about converting it all to SAX! the API reference,http://developer.android.com/intl/de/reference/org/w3c/dom/EntityRefe..., appears to say that character references should be expanded. What HTML or XML processor, refered to in the API, are you using? I'm not sure what these terms mean exactly so I may not be responding accurately. I use the following to retrieve a response from the server: ResponseHandlerString responseHandler = new BasicResponseHandler(); String xmlResponse = httpClient.execute(getMethod, responseHandler); (httpClient is from org.apache.http.client.HttpClient) I then create a document using the following: DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new ByteArrayInputStream(xmlResponse.getBytes())); Regards. Julius. -- 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 -- 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 all text (including encoded) from XML Text Node
Hi, I have a very basic question regarding encoded text in an XML Text node. I am using the DOM parser javax.xml.parsers.DocumentBuilder to parse some xml. The xml has some international characters which are encoded in decimal unicode - eg. 'ó' is '#243;'. The parser takes the encoded character out of the word for example jóbb and the Text node is left with jbb as the node value. If I use getData() on the Text node it returns jbb also. The character is not lost though - a sibling Node, an Entity Reference Node, has the decimal value and an index. The index value corresponds to where this character should be inserted. In this case for example if would have an index of 1 and value of '#234'. This indicates that there must be a simple way of accessing the value of the Text node of its parent in such a way as to get 'jóbb'. It seems unlikely that I need to reconstruct this by doing a lookup to convert the encoded character to utf8 and then insert it into the string for the Text node. Does anyone know how this works? Sorry for asking what is probably a really basic question, but I can't find the answer. Thank you for any help. Regards, Julius. -- 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] Get all text (including encoded) from XML Text Node
Hi, Thank you for the reply. Something's not right. Although I have no experience with DocumentBuilder, (ask me a SAXParser question, please!) I'm starting to think about converting it all to SAX! the API reference, http://developer.android.com/intl/de/reference/org/w3c/dom/EntityReference.html, appears to say that character references should be expanded. What HTML or XML processor, refered to in the API, are you using? I'm not sure what these terms mean exactly so I may not be responding accurately. I use the following to retrieve a response from the server: ResponseHandlerString responseHandler = new BasicResponseHandler(); String xmlResponse = httpClient.execute(getMethod, responseHandler); (httpClient is from org.apache.http.client.HttpClient) I then create a document using the following: DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new ByteArrayInputStream(xmlResponse.getBytes())); Regards. Julius. -- 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] Get all text (including encoded) from XML Text Node
On closer inspection the index part I have misinterpreted - the whole string might be broken into parts eg. Text node j EntityReference node ó Text node bb Regards, Julius. (on closer inspection zees are loafers) On 3/07/2010, at 2:47 PM, Julius Spencer wrote: Hi, Thank you for the reply. Something's not right. Although I have no experience with DocumentBuilder, (ask me a SAXParser question, please!) I'm starting to think about converting it all to SAX! the API reference, http://developer.android.com/intl/de/reference/org/w3c/dom/EntityReference.html, appears to say that character references should be expanded. What HTML or XML processor, refered to in the API, are you using? I'm not sure what these terms mean exactly so I may not be responding accurately. I use the following to retrieve a response from the server: ResponseHandlerString responseHandler = new BasicResponseHandler(); String xmlResponse = httpClient.execute(getMethod, responseHandler); (httpClient is from org.apache.http.client.HttpClient) I then create a document using the following: DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(new ByteArrayInputStream(xmlResponse.getBytes())); Regards. Julius. -- 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
Re: [android-developers] Creating ContextMenu based on information from Cursor
Eg. should it be in the View? I could make the decision when creating the menu too, but I need to get a unique id from the row in the ListView public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { Cast the menuInfo to an AdapterView.AdapterContextMenuInfo. You then have access to the position of the row within your result set, and the ID of the row (if you are using CursorAdapter or otherwise have row IDs). Thank you this worked perfectly. I didn't think to look at this object... http://developer.android.com/resources/articles/touch-mode.html Thank you for pointing me to this - it certainly makes sense now why it seemed there was no selection. -- 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] Creating ContextMenu based on information from Cursor
Hi, I have a ListView which is populated with items and I would like to be able to create the context menu based on some information fetched from the Cursor used to create the row. Is there a preferred approach for storing a boolean or flag associate with the row? Eg. should it be in the View? I could make the decision when creating the menu too, but I need to get a unique id from the row in the ListView public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { ListView listView = (ListView) v; Also listView.getSelectedItem() seems to return null, listView.getSelectedItemId() gives a very negative number and listView.getSelectedView() is null too. I thought that the mSelectedItem in the listView would be populated when creating the context menu. Or it could be some typo somewhere... :) Thank you for any ideas. Regards, Julius. -- 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] Images in ListView in wrong places
Hi, I have a ListView which has rows that include an ImageView. I am populating the ImageView with the following code (getting the image from the SDCard if available): Bitmap bmp = BitmapFactory.decodeFile(filename); ImageView iv = getCoverImageView(); if(null!=iv) iv.setImageBitmap(bmp); However when I scroll and the images are loaded they seem to turn up in the wrong places. The ListView is populated through a CursorAdapter: @Override public void bindView(View row, Context ctxt, Cursor c) { SDIReleaseWrapper wrapper = (SDIReleaseWrapper) row.getTag(); wrapper.populateFrom(c); } @Override public View newView(Context ctxt, Cursor c, ViewGroup parent) { LayoutInflater inflater = getLayoutInflater(); View row = inflater.inflate(R.layout.release_row, parent, false); SDIReleaseWrapper wrapper = new SDIReleaseWrapper(row); row.setTag(wrapper); wrapper.populateFrom(c); return row; } and the rows are populated with information from the database through the wrapper. The TextViews in the rows show up fine, but the ImageViews seem to have random effects. I'm not really understanding the process of populating an ImageView in the row or why the ImageView doesn't know which row to populate with the image. If someone could point me in the right direction that would be great. -- 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] Images in ListView in wrong places
Hi Mark, Thank you for the reply. You could use iv.setImageURI(Uri.fromFile(...)). Oh great, yes I did read that. :) However when I scroll and the images are loaded they seem to turn up in the wrong places. Are you doing the image loading in the main application thread, or a background thread (e.g., AsyncTask)? I believe I am using the main application thread - perhaps this would be better using a background thread. For the moment though the list is small. If you are using a background thread, bear in mind that you may have scrolled before the image gets put into the list. I'll keep this in mind when moving to this method. Are you sure your SDIReleaseWrapper is pointing to the right ImageView? Yes I performed a search and the only layout (or xml file for that matter) with release_icon in it is release_row, which I am trying to populate. Is your above bitmap-loading code part of populateFrom()? Yes that is correct: void populateFrom(Cursor c) {... There is a unique id in the Cursor (result) I can use to reference the file. I omitted that the adapter (SDIReleaseAdapter) implements SectionIndexer although I'm assuming this won't affect things. Regards, Julius. -- 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] Images in ListView in wrong places
Well, all I can tell you is that the symptom of images seem randomized when I scroll usually points to some sort of binding problem. Julius Spencer wrote: Are you sure your SDIReleaseWrapper is pointing to the right ImageView? Yes I performed a search and the only layout (or xml file for that matter) with release_icon in it is release_row, which I am trying to populate. Actually, that doesn't strictly answer my question. For example, when you are looking up that ImageView, are you calling findViewById() on the row View, or on the Activity? You need to look it up on the row -- otherwise, the Activity will return to you the first instance of your ImageView with that name it finds in the list. Genius. (on your behalf - stupidity on mine...) I had missed out row. Sorry for such a silly question... Thank you once again! Would you recommend filling the images via an AsyncTask given they are coming from the SDCard? Regards, Julius. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Modify data retrieved for View from SimpleCursorAdapter
Hi, I have a SimpleCursorAdapter for a list which returns data from a SQLite database as it appears in the database. I would like to be able to change the data as it shows in the View so if I have a long representing a timestamp I can format it using DateFormat.format. Can anyone recommend a good way to go about this? (maybe I need to subclass SimpleCursorAdapter and override a method?) I also keep a foreign key in this record so I would like to be able to get another object from the database and put part of this in the View as well. Previously I used an ArrayAdapter but this caused me issues requerying the list. Thanks for any ideas or pointers. -- 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: Modify data retrieved for View from SimpleCursorAdapter
I tend to override bindView() in a SimpleCursorAdapter subclass for situations like this. Thanks Mark, this works perfectly. I copied the concepts from an excerpt I found from your book. (just purchased) Use a JOIN clause in your SQLite rawQuery() that builds the Cursor. Thanks for the direction - I'll sort this out now. -- 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] ListView
Hi, I have an ArrayAdapter which is used to show a list in a ListActivity. This list is updated from time to time and when this happens I call notifyDataSetChanged() on the ArrayAdapter. This works well as the Activity shows the changes (eg. adding a new item to the list). However, when I select/click on an item, the wrong Object is being selected: onListItemClick(ListView l, View v, int position, long id) { The position is correct, but: getListView().getItemAtPosition(position); yields the object which was in the position of the previous list. I'm wondering how can I update the ListView when I notifyDataSetChanged() so that an update ListView is referred to in: getListView().getItemAtPosition(position); Thank you for any 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: ListView not updated with ArrayAdapter notifyDataSetChanged()
Apologies for not entering in the subject... On Mar 18, 10:47 am, julius jul...@msa.co.nz wrote: Hi, I have an ArrayAdapter which is used to show a list in a ListActivity. This list is updated from time to time and when this happens I call notifyDataSetChanged() on the ArrayAdapter. This works well as the Activity shows the changes (eg. adding a new item to the list). However, when I select/click on an item, the wrong Object is being selected: onListItemClick(ListView l, View v, int position, long id) { The position is correct, but: getListView().getItemAtPosition(position); yields the object which was in the position of the previous list. I'm wondering how can I update the ListView when I notifyDataSetChanged() so that an update ListView is referred to in: getListView().getItemAtPosition(position); Thank you for any 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: ListView
Hi, Thank you for the quick reply. The ArrayAdapter gets information from a SQLite DB and I'm currently adding a record to the DB and then refreshing the ArrayAdapter. I'm not sure whether this is the right way to go about it though. Calling add(), insert() or remove() doesn't quite fit into how I'm doing it; but I could change all that perhaps if it it would be better. Without trying to be difficult, is there a way I could maintain my existing structure? Thanks again. On Mar 18, 10:51 am, Mark Murphy mmur...@commonsware.com wrote: julius wrote: I have an ArrayAdapter which is used to show a list in a ListActivity. This list is updated from time to time and when this happens I call notifyDataSetChanged() on the ArrayAdapter. You don't need to do that. Just call add(), insert(), or remove() on the ArrayAdapter itself to make changes, and everything should work just fine. -- 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
[android-developers] Re: ListView
Thanks for the help. Sorry for not supplying the info abut having the DB. On Mar 18, 11:04 am, Mark Murphy mmur...@commonsware.com wrote: julius wrote: The ArrayAdapter gets information from a SQLite DB and I'm currently adding a record to the DB and then refreshing the ArrayAdapter. I'm not sure whether this is the right way to go about it though. Try using CursorAdapter instead. When you modify the database, call refresh() on the Cursor, and everything else will update automatically. Without trying to be difficult, is there a way I could maintain my existing structure? Sorry, but I have no idea what your existing structure is. Your original post provided insufficient information to comment. However, in general, either: -- use ArrayAdapter and modify it through add(), etc. -- use CursorAdapter and refresh it via requery() on the Cursor -- write your own Adapter as a subclass of BaseAdapter -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training in US: 14-18 June 2010:http://bignerdranch.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] Update extras for paused Activity
Hi, If I have a paused Activity is it possible to create an intent which will update its extras? In this case I have a Service which creates a Notification. The Notification has an Intent with extras. I find that if I have the Activity set up with: launchMode=singleTask when the Activity is resumed, null==getIntent().getExtras(). If the Activity is not paused (hasn't been started) null! =getIntent().getExtras(). Just wondering if there is a simple way of solving this. Thanks for any 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: Update extras for paused Activity
Look up Activity.onNewIntent(). Thank you that was just what I was looking for! -- 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
Hi, I have a notification which is being created with a PendingIntent setup with some extras in the Intent. After the first notification is created, all subsequent notifications have the same values in their extras as the first, even though the notification and the extras are being updated. This means that when the notification is selected and a value is taken from the extra (eg. timestamp) it has the timestamp of the first notification rather than the most recent. All the books I read say that when the notifiers match the old Notification is updated instead of creating a new one (or something along those lines). If this isn't how it works, is there a way to achieve a change in the information attached to the notification? 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: Multiple Notifications
Oh gee thank you, I didn't see that. On Mar 5, 8:13 am, Mark Murphy mmur...@commonsware.com wrote: julius wrote: I have a notification which is being created with a PendingIntent setup with some extras in the Intent. After the first notification is created, all subsequent notifications have the same values in their extras as the first, even though the notification and the extras are being updated. You need to use FLAG_UPDATE_CURRENT or FLAG_CANCEL_CURRENT or something to update the extras in an existing PendingIntent. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to determine if Activity is on screen
Furthermore, a BroadcastReceiver has no good way of communicating to a running activity, let alone determining if there is one there. Yeah I was kinda having trouble with this part... :) Now, if you take the BroadcastReceiver out of the equation, your dialog-raising Activity could register itself with the service (e.g., bindService(), then call some API offered by the service). When the service wishes to notify the user, it checks to see if a listener is registered. If so, it calls a method on that listener, which triggers the activity to display the dialog. If there is no listener, the service raises the notification. Just be sure to unregister the listener as the activity exits. This sounds excellent. I was using a BroadcastReceiver as the Service has ProximityAlerts set up , each of which expects a PendingIntent. I had each PendingIntent send a broadcast. I guess I'll need to use PendingIntent.getService() to start the process of notification or call method on the listener. Thank you for the guidance. -- 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: How to determine if Activity is on screen
I was using a BroadcastReceiver as the Service has ProximityAlerts set up , each of which expects a PendingIntent. I had each PendingIntent send a broadcast. I guess I'll need to use PendingIntent.getService() to start the process of notification or call method on the listener. Actually I'll just scrap using ProximityAlerts and do tha calculations myself. Then I can do away with PendingIntents and act on location updates as you describe. It looks like the getService() is for a different scenario. Thanks again for 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
Re: [android-developers] Display Dialog from notification
Thanks for the reference Mark. I realised from an Activity I can just finish it and it will show the other Activity. On 3/03/2010, at 7:45 AM, Mark Murphy wrote: julius wrote: 1. Is it possible to show an AlertDialog (from the notification) without sending the user to a new Activity? (This way the user can click No and resume working in any other application) I don't think so. You can always create a dialog-themed activity, so it looks like a dialog, but isn't. 2. A ListActivity already exists in this application. If the user clicks yes the user should be send to this existing Activity. Currently I'm dong this from a new activity in the application using: startActivity(new Intent(this,MSPMain.class)); I believe this is making a new instance of the Activity rather than simply showing the existing Activity. Is there a way to show the existing Activity without making starting a new one? Look at android:launchMode: http://developer.android.com/guide/topics/manifest/activity-element.html#lmode -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in NYC: 1-2 May 2010: http://guruloft.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 -- 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] Update Activity from BroadcastReceiver
Hi, Does anyone know how I might go about accessing an Activity in an application from a BroadcastReceiver (in the same application)? (I have some state information in the Activity I'd like to update) I'm not sure if there is a best practice for it. Thanks for any 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] Display Dialog from notification
Hi, I have a situation where I have a broadcast receiver which creates a notification and the notification, when selected, sends the application to a new Activity with a yes/no AlertDialog. I have two questions: 1. Is it possible to show an AlertDialog (from the notification) without sending the user to a new Activity? (This way the user can click No and resume working in any other application) 2. A ListActivity already exists in this application. If the user clicks yes the user should be send to this existing Activity. Currently I'm dong this from a new activity in the application using: startActivity(new Intent(this,MSPMain.class)); I believe this is making a new instance of the Activity rather than simply showing the existing Activity. Is there a way to show the existing Activity without making starting a new one? I hope this makes sense... :) Thank you for any 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: Testing location using network as location provider?
Thanks for the reply. I'm really trying to respond to changes. This is a good idea to kick things off, but I'd like to be able to show changes so I can turn the GPS service on/off. Is there a way to do fake this in the emulator? Regards, Julius. On Jan 29, 2:50 am, WoodManEXP woodman...@gmail.com wrote: Sure, simply hard code the test coordinate in your app at the point you would otherwise call the LocationManager to get the last known location. Not too elegant, but it has worked over here on many occasions... On Jan 27, 10:57 pm, julius jul...@msa.co.nz wrote: Hi, I have an application which uses the network as the location provider (rather than GPS eg.), however I can't seem to figure out how to send the emulator test coordinates. In DDMS I would usually send coordinates in the Emulator Control tab. Is there a place to simulate coordinates derived from the cell phone network provider? Thanks for any help. (If I try to get the last known location I get: java.lang.IllegalArgumentException: provider=network) -- 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: Testing location using network as location provider?
Heh yeah I was coming to the conclusion it might be some kind of Timer setup for testing... Thanks for the reply. On Jan 29, 8:53 am, Robert Woodruff woodman...@gmail.com wrote: I have not found a way to do it in the emulator. All the GPS/location testing I do on a real device. Sometimes I get in the car and drive around to get more real world situation. Of course what you quickly discover is how crummy the GPS works in a car (or in a mall) :-). If you are testing with cellular locations rather than GPS locations you may need to do alot more moving around as the cellular location system is not so granular as real GPS. You may want to rig up a little ticker inside your app to feed location updates to the app for bench testing. Just put a sting array of coordinates in the resource fork and use the Timer class to drive the coordinate reader/feeder. It will simulate OK. But for location stuff actually getting out and moving the device around has been important. It is alot of fun just you and the stupid android and a laptop on the front seat stopping in parks and parking lots to toy with Eclipse and DDMS. Now if Google could just arrange for these apps to sell better... On Thu, Jan 28, 2010 at 2:10 PM, julius jul...@msa.co.nz wrote: Thanks for the reply. I'm really trying to respond to changes. This is a good idea to kick things off, but I'd like to be able to show changes so I can turn the GPS service on/off. Is there a way to do fake this in the emulator? Regards, Julius. On Jan 29, 2:50 am, WoodManEXP woodman...@gmail.com wrote: Sure, simply hard code the test coordinate in your app at the point you would otherwise call the LocationManager to get the last known location. Not too elegant, but it has worked over here on many occasions... On Jan 27, 10:57 pm, julius jul...@msa.co.nz wrote: Hi, I have an application which uses the network as the location provider (rather than GPS eg.), however I can't seem to figure out how to send the emulator test coordinates. In DDMS I would usually send coordinates in the Emulator Control tab. Is there a place to simulate coordinates derived from the cell phone network provider? Thanks for any help. (If I try to get the last known location I get: java.lang.IllegalArgumentException: provider=network) -- 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] Testing location using network as location provider?
Hi, I have an application which uses the network as the location provider (rather than GPS eg.), however I can't seem to figure out how to send the emulator test coordinates. In DDMS I would usually send coordinates in the Emulator Control tab. Is there a place to simulate coordinates derived from the cell phone network provider? Thanks for any help. (If I try to get the last known location I get: java.lang.IllegalArgumentException: provider=network) -- 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: Preference Validation
Thank you very much for the reply. I'll give that a go. It would be nice if there were a regex option and an error message option in the SDK and some kind of validate for save in the popup (when clicking OK). Hey I can dream... Thanks again! On Dec 9, 4:43 pm, Dean_Kreger kool.n...@gmail.com wrote: Hey julius, You will have to extend the EditTextPreference class and override some methods in the underlying EditText (use getEditText()). Best bet would be to make your own key listener, and have it check what the current text in your EditText is. Then in your preference XML (or whatever), you'll have to change your EditTextPreference to com.your.package.ExtendedEditTextPreference. On Dec 8, 10:36 pm, julius jul...@msa.co.nz wrote: Hi, If I have a Preference Activity and it has an edittext input, how would I go about say limiting the input to integers between 1 and 300? I've looked around and I can't seem to find anything regarding Preference Validation. 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] Preference Validation
Hi, If I have a Preference Activity and it has an edittext input, how would I go about say limiting the input to integers between 1 and 300? I've looked around and I can't seem to find anything regarding Preference Validation. 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
Re: [android-developers] G1 Wifi issue
Hi, I have looked in the source found online and it looks like the config in the following code is not being set. WifiConfiguration config = findConfiguredNetwork(state); private WifiConfiguration findConfiguredNetwork(AccessPointState state) { final ListWifiConfiguration wifiConfigs = getConfiguredNetworks(); for (int i = wifiConfigs.size() - 1; i = 0; i--) { final WifiConfiguration wifiConfig = wifiConfigs.get(i); if (state.matchesWifiConfiguration(wifiConfig) = AccessPointState.MATCH_WEAK) { return wifiConfig; } } return null; } So I guess the following isn't working: if (state.matchesWifiConfiguration(wifiConfig) = AccessPointState.MATCH_WEAK) { return wifiConfig; } Does anyone know who wrote this? It looks like it's going through the available access points list in reverse, but after that I'm kinda lost. Regards, Julius. On 18/11/2009, at 8:27 AM, julius wrote: Hi, I continue to have issues with the Wifi on my G1 (running 1.6). When I hook it up to Eclipse I see the following errors when I try to connect to an access point: 11-18 08:20:10.204: ERROR/SettingsWifiLayer(6434): Config is still null, even after attempting to add it. 11-18 08:20:10.204: ERROR/SettingsWifiLayer(6434): Unable to connect to the network This occurs with all (6) access points that I use at different times. Almost every access point is a different brand or model. Has anyone seen this issue? Regards, Julius. -- 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] lock_layer timed out (is the CPU pegged?)
Hi, I have a situation occurring intermittently with an application where I receive the following message. It's probably something to do with a Thread. The application seems to stop, but I get the following message and I'm not sure what it means: WARN/SurfaceComposerClient(2106): lock_layer timed out (is the CPU pegged?) layer=1, lcblk=0x424800a0, state=0043 (was 0043) I see others have had this issue, but I don't see a solution or explanation (that I can understand :-) ). Can anyone point me in the right direction? Thanks for any help. Regards, Julius. -- 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