Re: [android-developers] Associate my app with file format
We generally don't do matching based on extension, but on MIME type. Ideally you want your server to reporting a proper MIME type for your file. Also, the MIME type matches only handles '*' for type and subtype -- that is, application/* or */*. Your 'application/emx*' will not match anything. On Sat, Jun 5, 2010 at 6:41 PM, jdeslip jdes...@gmail.com wrote: I am writing an app that needs to be able to open (be associated in the browser download window for example) with a certain file type. The file type has .emx extension and is in an xml format (the top of the files have ?xml version='1.0' encoding=UTF-8? ). However, I can't for the life of me get my app associated with this filetype. I have tried the following in my Manifest: intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:mimeType=application/xml/ data android:mimeType=application/rss+xml/ data android:mimeType=application/emx+xml/ data android:mimeType=application/*xml/ data android:mimeType=text/xml/ data android:mimeType=application/emx/ data android:mimeType=application/emx*/ data android:mimeType=application/xml*/ /intent-filter with no luck. I can get the filetype associated properly with my app if I do the following: intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:mimeType=application/*/ /intent-filter but this also associates my app with every file format (which I obviously don't want though I see that snesnoid does this for example). Does anyone know how I can associate my app with this .emx file format alone? -- You received this message because you are subscribed to the Google Groups Android Developers group. 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is it possible to draw to a home screen icon?
Actually the appwidgets do support standard animations such as tweening and frame, but they are a bit of a hack job to get to work. For tweening, you get use the layoutAnimation tag in your widgets XML. It supports all the standard tween animations. When the remote views object for that widget is first displayed, i.e. the widget added to the home screen, the animation will show. But it wont show on subsequent update calls to the same XML file, so you can duplicate your widgets xml file, call it something else, and swap between them when updating. Thus your tween animation will show every time you update. For frame animations, you can use prebuilt animation xml drawables and load them into a indeterminateDrawable of a Indeterminate ProgressBar element in your appwidget. As long as you are sensible about how long the animation lasts for, and don't have it playing permanently this is fine on the battery. Mark, regarding the battery comment, could you or someone elaborate? I have heard this countless times but with no justification. Is there something intrinsically inefficient about updating an appwidget with RemoteViews, more so than some other operation? For example, if I am trying to fake a 5 second widget animation by frequent updating an imageview over 5 seconds using RemoteViews, does that consume more battery than doing a similar operation on a imageview in an Activity? Or is it more the assumption that such animations would be playing permanently, which would not be best practice and I could see of course would drain the battery? It just seems to me that having a short animation play in response to a certain situation, or being triggered by the user shouldn't drain the battery any more than the same process in an activity, unless RemoteViews itself is a battery drainer. Thanks for any thoughts.. On Jun 6, 8:19 am, Mark Murphy mmur...@commonsware.com wrote: Rob Y. wrote: I think it could be cuter if it were possible to get a surface view that mapped to the home screen icon for the app and animate that when the app is running and the icon is visible. I am uncertain as to what the icon is. I can think of four possibilities: -- the icon in the launcher -- a shortcut icon the user put on their home screen -- a Notification icon in the status bar -- an app widget None of those can be animated in the form you describe. The icons are all resources, so at most you can try an AnimationDrawable resource, but I suspect most of those won't support the actual animating. An app widget does not support any of the standard animations, and attempting to fake it by extremely frequent updates will drain your battery quickly. You might give live wallpapers a try, though. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Associate my app with file format
Thanks, Ya, I figured application/emx* would not match anything; but I was grasping at straws. The server side of things is not in my control. I have to deal with the .emx files being downloaded with empty mimetype - or give up the enterprise entirely. :/ Usining mimetype=applcation/* is the only thing so far that allows me to download these .emx files in the browser and then open them from the downloads screen. Why does the browsers' download screen not recognize the path based associations like the various file managers do? Is there a scheme I am missing for the browser? -Jack On Jun 5, 11:02 pm, Dianne Hackborn hack...@android.com wrote: We generally don't do matching based on extension, but on MIME type. Ideally you want your server to reporting a proper MIME type for your file. Also, the MIME type matches only handles '*' for type and subtype -- that is, application/* or */*. Your 'application/emx*' will not match anything. On Sat, Jun 5, 2010 at 6:41 PM, jdeslip jdes...@gmail.com wrote: I am writing an app that needs to be able to open (be associated in the browser download window for example) with a certain file type. The file type has .emx extension and is in an xml format (the top of the files have ?xml version='1.0' encoding=UTF-8? ). However, I can't for the life of me get my app associated with this filetype. I have tried the following in my Manifest: intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:mimeType=application/xml/ data android:mimeType=application/rss+xml/ data android:mimeType=application/emx+xml/ data android:mimeType=application/*xml/ data android:mimeType=text/xml/ data android:mimeType=application/emx/ data android:mimeType=application/emx*/ data android:mimeType=application/xml*/ /intent-filter with no luck. I can get the filetype associated properly with my app if I do the following: intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT / category android:name=android.intent.category.BROWSABLE / data android:mimeType=application/*/ /intent-filter but this also associates my app with every file format (which I obviously don't want though I see that snesnoid does this for example). Does anyone know how I can associate my app with this .emx file format alone? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Setting theme in an activity
Hi All, This is my themes.xml file resources style name=*Theme.Blue* parent=*android:Theme* item name=*android:windowBackground**...@drawable*/bodyimg_blue/item item name=*android:colorBackground*@color/*royalblue*/item item name=*android:textColor*@color/*midnightblue*/item item name=*android:textViewStyle*@style/TextViewBlue/item /style resources This is main activity code snippet *public* *void* onCreate(Bundle savedInstanceState) { *super*.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout.*main_screen*); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Is it possible to draw to a home screen icon?
On Sat, Jun 5, 2010 at 11:09 PM, James W jpbwebs...@gmail.com wrote: Mark, regarding the battery comment, could you or someone elaborate? I have heard this countless times but with no justification. Is there something intrinsically inefficient about updating an appwidget with RemoteViews, more so than some other operation? For example, if I am trying to fake a 5 second widget animation by frequent updating an imageview over 5 seconds using RemoteViews, does that consume more battery than doing a similar operation on a imageview in an Activity? Or is it more the assumption that such animations would be playing permanently, which would not be best practice and I could see of course would drain the battery? Both. If your widget is updating every 5 seconds... well, you are running your code every 5 seconds the entire time the device is able to run, which is going to kill the battery. It doesn't matter if you were doing this in your own process or elsewhere. Also RemoteViews is not a negligible. There is nothing intrinsically inefficient about it compared to other things... but building a view hierarchy and updating it is not close to a 0-cost thing. And there is the additional overhead of the work you do needing to be communicated to the system, and then to the home screen, where it needs to execute your UI operations (worse case having to re-inflate and build your view hierarchy). -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Calling wait in AsyncTask (e.g. inside doInBackground) raises IllegalMonitorStateException
On Sat, Jun 5, 2010 at 3:20 PM, Al alcapw...@googlemail.com wrote: What does the exception stack trace say? Are you synchronizing access to the object before calling wait()? Just wait() without synchronization will cause an IllegalMonitorStateException. Indeed, this problem likely has nothing to do with AsyncTask, but improper use of wait. There is nothing restricting you from using wait() from inside of AsyncTask. It's just running a thread. That said, AsyncTask schedules all work on a single thread in the process. So if you try to schedule two things, and one may wait for the other, you are likely going to cause a deadlock since the task can't complete, to allow the other to run. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Changing screens - switching between layouts?
Thank you for the contribution TreKing. I learned about start new activities using the Intent objects. However I don't thing it is suitable for my idea. Intent are useful in apps that have one 'menu' screen which has many buttons leading to other screens. In my app I don't want any menu screen - each screen has only one button leading to the next screen(maybe in the future it would have a second one working as a 'back' button). So you start with screen A with 1 button, you press it and go to screen B with 1 button, you press it and go to screen C with 1 button, you press it and return to screen A.This forms a kind of 'ring' of screens. So I don't see a way to do it with starting new activities. More over I need to pass Java objects holding data 'between the screens' and I also don't know how to pass such an object to a new activity. Your advice is good and popular but not proper for my idea. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Changing screens - switching between layouts?
Why couldn't you have each button on the activity start the next activity? On Sun, Jun 6, 2010 at 12:22 AM, Serdel adam.lichwierow...@gmail.comwrote: Thank you for the contribution TreKing. I learned about start new activities using the Intent objects. However I don't thing it is suitable for my idea. Intent are useful in apps that have one 'menu' screen which has many buttons leading to other screens. In my app I don't want any menu screen - each screen has only one button leading to the next screen(maybe in the future it would have a second one working as a 'back' button). So you start with screen A with 1 button, you press it and go to screen B with 1 button, you press it and go to screen C with 1 button, you press it and return to screen A.This forms a kind of 'ring' of screens. So I don't see a way to do it with starting new activities. More over I need to pass Java objects holding data 'between the screens' and I also don't know how to pass such an object to a new activity. Your advice is good and popular but not proper for my idea. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] permission denied on devce
Did you set the right permissions for the app that allow you to use/store data? On Sat, Jun 5, 2010 at 9:39 PM, amsale zelalem amt...@yahoo.com wrote: Hello guys, I have developed and tested my app on the emulator, and now want to install it on my HTC device. the apk installs successfully, however my database is not going with it. I have created my database using sqliteman browser b/c I have to insert a bulk data before the app starts. I have four tables in my db and call each in different activities and created all on the sqliteman. after the data is inserted I pull back the db onto the data folder of the emulator. it works perfect on the emulator but failed on the device. when I try to pull my db on the real device, it shows access denied problem Please can anyone help me out? it is very urgent thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Multitasking on Android - Why So Incredibly Bad?
The problem here is that you're hitting Android's out-of-memory limits as mentioned above. if you have only 20megs of memory left that means that Android has already cleared out virtually all the empty applications (refer to app lifecycle http://developer.android.com/guide/topics/fundamentals.html#lcycles) so when you open your browser with lots of tabs it will need more memory. When you are using your browser it has the highest priority and will only be considered for killing if your available memory is less than 6 megs. Which is must be very close to in your scenario. Once you switch to another app the Browser become a background app which has lower priority and so will get killed off immediately to free up memory for the app you are currently using. As suggested my Mark and the others there are really 2 problems here. 1/ The browser isn't saving state properly when it is killed during a low memory kill off. Maybe this is a bug or an implementation issue? 2/ You may want to change you usage pattern. For whatever reason even before you start using the browser you are already very low (by the System's standards) on memory. This could be caused by having many widgets and services running in the background. To be honest even a Nexus One with more RAM than a Milestone/Droid could be made to struggle with 8 to 10 tabs open. The thing is a lot of these web pages are not mobile optimized so you are loading what is really meant to run on a desktop with much more resources. So your scenario can be replicated on any phone. In fact you may also notice that your Alarm may stop working and other stateful apps will have the same problem from time to time because of the same reason. On Jun 5, 11:13 pm, Simon Broenner simonbroen...@gmail.com wrote: Hello everyone! First of all I'd like to thank you all for your helpful tips and information about what could be causing the problem. That said, I'd like to address a few points that have been mentioned: 1. I'm not concerned about reboots or Force Closes - if the device is rebooted or the browser has a FC fit, I don't expect all of my windows to be restored. It'd be a nice feature, but not something necessary, like being able to resume a browser session after only having minimized it. 2. The primary suspect, in my eyes, is still the free program memory (not RAM but the Flash in which applications are installed) - it seems to me that if the browser cannot find enough free phone memory to save its state, the saving process fails silently. This is supported by the observation I made earlier - with 20MB of phone memory free, I was able to reproduce the problem with 8-10 simple forum/e-mail pages open. With 50MB of phone memory free, I was only able to reduce the problem if at least 4 or 5 of the open tabs were very graphically intensive (and therefore memory intensive) sites. Diane wrote: *To investigate these, you can use adb shell dumpsys activity to see the activity stack (in particular the browser activity entry) at various points. When it is in the background, does it say it has the saved state? Right before restarting it, is the entry still there will the saved state? If so, then there is most likely something going on when the browser tries to restore its state. If not, then something earlier is going buggy when the state is saved. *I'll give this a try tomorrow... can't make any promises, however, as I'm still very new to Android development - haven't gotten much farther than Hello World and a few pages of the Developer's Guide so far ;) Thanks again for all your help! On Sat, Jun 5, 2010 at 11:29 PM, Dianne Hackborn hack...@android.comwrote: I am pretty sure the browser saves its state in onSaveInstanceState, not persistently, and this is currently as intended. That is, it will retain its state when its process gets killed and restarted, but it is deliberately not trying to retain its state across reboots. Note that instance state is always saved before pause, BEFORE an app goes to the background. So that is the key point for state saving; after that, it doesn't matter when the process gets killed, nor is there a need to let the app do anything before it gets killed, the activity manager already has its saved state so it can be used to restore the activity in a new process. There are two main ways the browser could be losing its state: To investigate these, you can use adb shell dumpsys activity to see the activity stack (in particular the browser activity entry) at various points. When it is in the background, does it say it has the saved state? Right before restarting it, is the entry still there will the saved state? If so, then there is most likely something going on when the browser tries to restore its state. If not, then something earlier is going buggy when the state is saved. On Sat, Jun 5, 2010 at 12:25 PM, Frank Weiss fewe...@gmail.com wrote: The
Re: [android-developers] Re: Multitasking on Android - Why So Incredibly Bad?
This could be because currently we give an app at most 1/5 second to return from onSaveInstanceState() + onPause() before going to the next app. If the browser is taking longer than that, we will give up and launch the next app, causing browser to go to the background. If we are under so much memory pressure at that point that the browser is immediately killed, then it may not have actually gotten to the point of giving its saved state to the system. On Sun, Jun 6, 2010 at 1:28 AM, lsim001 lim@gmail.com wrote: The problem here is that you're hitting Android's out-of-memory limits as mentioned above. if you have only 20megs of memory left that means that Android has already cleared out virtually all the empty applications (refer to app lifecycle http://developer.android.com/guide/topics/fundamentals.html#lcycles) so when you open your browser with lots of tabs it will need more memory. When you are using your browser it has the highest priority and will only be considered for killing if your available memory is less than 6 megs. Which is must be very close to in your scenario. Once you switch to another app the Browser become a background app which has lower priority and so will get killed off immediately to free up memory for the app you are currently using. As suggested my Mark and the others there are really 2 problems here. 1/ The browser isn't saving state properly when it is killed during a low memory kill off. Maybe this is a bug or an implementation issue? 2/ You may want to change you usage pattern. For whatever reason even before you start using the browser you are already very low (by the System's standards) on memory. This could be caused by having many widgets and services running in the background. To be honest even a Nexus One with more RAM than a Milestone/Droid could be made to struggle with 8 to 10 tabs open. The thing is a lot of these web pages are not mobile optimized so you are loading what is really meant to run on a desktop with much more resources. So your scenario can be replicated on any phone. In fact you may also notice that your Alarm may stop working and other stateful apps will have the same problem from time to time because of the same reason. On Jun 5, 11:13 pm, Simon Broenner simonbroen...@gmail.com wrote: Hello everyone! First of all I'd like to thank you all for your helpful tips and information about what could be causing the problem. That said, I'd like to address a few points that have been mentioned: 1. I'm not concerned about reboots or Force Closes - if the device is rebooted or the browser has a FC fit, I don't expect all of my windows to be restored. It'd be a nice feature, but not something necessary, like being able to resume a browser session after only having minimized it. 2. The primary suspect, in my eyes, is still the free program memory (not RAM but the Flash in which applications are installed) - it seems to me that if the browser cannot find enough free phone memory to save its state, the saving process fails silently. This is supported by the observation I made earlier - with 20MB of phone memory free, I was able to reproduce the problem with 8-10 simple forum/e-mail pages open. With 50MB of phone memory free, I was only able to reduce the problem if at least 4 or 5 of the open tabs were very graphically intensive (and therefore memory intensive) sites. Diane wrote: *To investigate these, you can use adb shell dumpsys activity to see the activity stack (in particular the browser activity entry) at various points. When it is in the background, does it say it has the saved state? Right before restarting it, is the entry still there will the saved state? If so, then there is most likely something going on when the browser tries to restore its state. If not, then something earlier is going buggy when the state is saved. *I'll give this a try tomorrow... can't make any promises, however, as I'm still very new to Android development - haven't gotten much farther than Hello World and a few pages of the Developer's Guide so far ;) Thanks again for all your help! On Sat, Jun 5, 2010 at 11:29 PM, Dianne Hackborn hack...@android.com wrote: I am pretty sure the browser saves its state in onSaveInstanceState, not persistently, and this is currently as intended. That is, it will retain its state when its process gets killed and restarted, but it is deliberately not trying to retain its state across reboots. Note that instance state is always saved before pause, BEFORE an app goes to the background. So that is the key point for state saving; after that, it doesn't matter when the process gets killed, nor is there a need to let the app do anything before it gets killed, the activity manager already has its saved state so it can be used to restore the activity in a new process.
[android-developers] Re: Published app not showing up on HTC Evo or Droid Incredible
Are the droid incr. And the evo running froyo? Because there is a security bug with android 2.2and the market On 5 Jun., 08:19, Alberto afonsec...@gmail.com wrote: Hello, I recently published our app to the marketplace and enabled copy protection. The app shows up when browsing the market on the Motorola Droid and others but does not appear when browsing with either the HTC Evo or Droid Incredible. Is this due to the copy protection? I'd like to keep my app copy protected but would like to make it available to customers of these two devices. Is this a bug or expected behavior and what are my options? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Digest for android-developers@googlegroups.com - 9 Messages in 7 Topics
Hi All, This is my themes.xml file resources style name=Theme.Blue parent=android:Theme item name=android:windowBackground@drawable/bodyimg_blue/item item name=android:colorBackground@color/royalblue/item item name=android:textColor@color/midnightblue/item item name=android:textViewStyle@style/TextViewBlue/item /style resources This is main activity code snippet public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout. main_screen); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Setting theme in an activity
Hi All, This is my themes.xml file resources style name=*Theme.Blue* parent=*android:Theme* item name=*android:windowBackground**...@drawable*/bodyimg_blue/item item name=*android:colorBackground*@color/*royalblue*/item item name=*android:textColor*@color/*midnightblue*/item item name=*android:textViewStyle*@style/TextViewBlue/item /style resources This is main activity code snippet *public* *void* onCreate(Bundle savedInstanceState) { *super*.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout. *main_screen*); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? Warm Regards, Sudeep -- Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Fwd: [android-developers] Digest for android-developers@googlegroups.com - 9 Messages in 7 Topics
Hi All, This is my themes.xml file resources style name=Theme.Blue parent=android:Theme item name=android:windowBackground@drawable/bodyimg_blue/item item name=android:colorBackground@color/royalblue/item item name=android:textColor@color/midnightblue/item item name=android:textViewStyle@style/TextViewBlue/item /style resources This is main activity code snippet public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout. main_screen); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? Warm Regards, Sudeep -- Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: LocationListener not refreshing ???
You have to write: setLocationListener in the activity On 6 Jun., 04:27, Lance Nanek lna...@gmail.com wrote: http://code.google.com/p/android/issues/detail?id=2545 On May 25, 8:35 am, Squ36 romain.goncal...@gmail.com wrote: Hi all. I'm trying to develop a small app, that can retrieve GPS coordinates, and store them, so I can retrace the path I took. The thing is, the GPS on Android emulator is kind of screwing around with my nerves... First of all, the Mock Position system doesn't work, so I'm manually fixing the coordinates with telnet geo fix command. Second of all, the location listener seems to not be refreshing. I'm lauching the app, fixing a first set of coordinates, and observing the response I expect. But when I push a second set of coordinates, the app simply doesn't react. I tried a lot -big lot- of ideas on this, and I'm kind of running short... By the way, I'm developping on Eclipse with ADT, and the SDK for Android 1.5 (French HTC Heros are still with Android 1.5) so that I can use my own app. Here's my code (just the coordinate retrieval part) : / */ /***Android GPS Coordinates Retrieval System*/ / */ package com.GPS; import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.widget.Toast; public class GPS extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); /* Use the LocationManager class to obtain GPS locations */ LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener mlocListener = new MyLocationListener(); mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1, 1, mlocListener); } /* Class My Location Listener */ public class MyLocationListener implements LocationListener { @Override public void onLocationChanged(Location loc) { loc.getLatitude(); loc.getLongitude(); String Text = My current location is: + Latitude = + loc.getLatitude() + Longitude = + loc.getLongitude(); Toast.makeText(getApplicationContext(), Text, Toast.LENGTH_SHORT) .show(); } @Override public void onProviderDisabled(String provider) { Toast.makeText(getApplicationContext(), Gps Disabled, Toast.LENGTH_SHORT).show(); } @Override public void onProviderEnabled(String provider) { Toast.makeText(getApplicationContext(), Gps Enabled, Toast.LENGTH_SHORT).show(); } @Override public void onStatusChanged(String provider, int status, Bundle extras) {} }/* End of Class MyLocationListener */ } / */ Thanks in advance for anyone who will spend some of his time helping me :) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Multitasking on Android - Why So Incredibly Bad?
Is there a way to increase the time that the browser (and/or other apps) has to save its state? Probably only with very deep changes in Android itself, if I'm not mistaken? On Sun, Jun 6, 2010 at 10:44 AM, Dianne Hackborn hack...@android.comwrote: This could be because currently we give an app at most 1/5 second to return from onSaveInstanceState() + onPause() before going to the next app. If the browser is taking longer than that, we will give up and launch the next app, causing browser to go to the background. If we are under so much memory pressure at that point that the browser is immediately killed, then it may not have actually gotten to the point of giving its saved state to the system. On Sun, Jun 6, 2010 at 1:28 AM, lsim001 lim@gmail.com wrote: The problem here is that you're hitting Android's out-of-memory limits as mentioned above. if you have only 20megs of memory left that means that Android has already cleared out virtually all the empty applications (refer to app lifecycle http://developer.android.com/guide/topics/fundamentals.html#lcycles) so when you open your browser with lots of tabs it will need more memory. When you are using your browser it has the highest priority and will only be considered for killing if your available memory is less than 6 megs. Which is must be very close to in your scenario. Once you switch to another app the Browser become a background app which has lower priority and so will get killed off immediately to free up memory for the app you are currently using. As suggested my Mark and the others there are really 2 problems here. 1/ The browser isn't saving state properly when it is killed during a low memory kill off. Maybe this is a bug or an implementation issue? 2/ You may want to change you usage pattern. For whatever reason even before you start using the browser you are already very low (by the System's standards) on memory. This could be caused by having many widgets and services running in the background. To be honest even a Nexus One with more RAM than a Milestone/Droid could be made to struggle with 8 to 10 tabs open. The thing is a lot of these web pages are not mobile optimized so you are loading what is really meant to run on a desktop with much more resources. So your scenario can be replicated on any phone. In fact you may also notice that your Alarm may stop working and other stateful apps will have the same problem from time to time because of the same reason. On Jun 5, 11:13 pm, Simon Broenner simonbroen...@gmail.com wrote: Hello everyone! First of all I'd like to thank you all for your helpful tips and information about what could be causing the problem. That said, I'd like to address a few points that have been mentioned: 1. I'm not concerned about reboots or Force Closes - if the device is rebooted or the browser has a FC fit, I don't expect all of my windows to be restored. It'd be a nice feature, but not something necessary, like being able to resume a browser session after only having minimized it. 2. The primary suspect, in my eyes, is still the free program memory (not RAM but the Flash in which applications are installed) - it seems to me that if the browser cannot find enough free phone memory to save its state, the saving process fails silently. This is supported by the observation I made earlier - with 20MB of phone memory free, I was able to reproduce the problem with 8-10 simple forum/e-mail pages open. With 50MB of phone memory free, I was only able to reduce the problem if at least 4 or 5 of the open tabs were very graphically intensive (and therefore memory intensive) sites. Diane wrote: *To investigate these, you can use adb shell dumpsys activity to see the activity stack (in particular the browser activity entry) at various points. When it is in the background, does it say it has the saved state? Right before restarting it, is the entry still there will the saved state? If so, then there is most likely something going on when the browser tries to restore its state. If not, then something earlier is going buggy when the state is saved. *I'll give this a try tomorrow... can't make any promises, however, as I'm still very new to Android development - haven't gotten much farther than Hello World and a few pages of the Developer's Guide so far ;) Thanks again for all your help! On Sat, Jun 5, 2010 at 11:29 PM, Dianne Hackborn hack...@android.com wrote: I am pretty sure the browser saves its state in onSaveInstanceState, not persistently, and this is currently as intended. That is, it will retain its state when its process gets killed and restarted, but it is deliberately not trying to retain its state across reboots. Note that instance state is always saved before pause, BEFORE an app goes to the background. So that is the key point for
[android-developers] Re: Associate my app with file format
Ya, I figured application/emx* would not match anything; but I was grasping at straws. The server side of things is not in my control. I have to deal with the .emx files being downloaded with empty mimetype - or give up the enterprise entirely. :/ Is working with a WebView compatible with your spec ? That is could your application be the browser to the emx file ? Because then I'm note sure how, but you can change pretty much everything that is coming from the server using webviewclient, a downloadlistener or WhatNot from the WebKit component. Yahel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Changing screens - switching between layouts?
Dear Serdel.. * * *If you follow your approach, then when you rotate the screen after setting content of screen C then it will start the * *1st screen A view, which is **not correct. So it is better to start new view with startActivity as suggested.* * * * * On Sun, Jun 6, 2010 at 1:15 PM, Kevin Duffey andjar...@gmail.com wrote: Why couldn't you have each button on the activity start the next activity? On Sun, Jun 6, 2010 at 12:22 AM, Serdel adam.lichwierow...@gmail.comwrote: Thank you for the contribution TreKing. I learned about start new activities using the Intent objects. However I don't thing it is suitable for my idea. Intent are useful in apps that have one 'menu' screen which has many buttons leading to other screens. In my app I don't want any menu screen - each screen has only one button leading to the next screen(maybe in the future it would have a second one working as a 'back' button). So you start with screen A with 1 button, you press it and go to screen B with 1 button, you press it and go to screen C with 1 button, you press it and return to screen A.This forms a kind of 'ring' of screens. So I don't see a way to do it with starting new activities. More over I need to pass Java objects holding data 'between the screens' and I also don't know how to pass such an object to a new activity. Your advice is good and popular but not proper for my idea. -- You received this message because you are subscribed to the Google Groups Android Developers group. 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Multitasking on Android - Why So Incredibly Bad?
Simon Broenner wrote: Is there a way to increase the time that the browser (and/or other apps) has to save its state? Probably only with very deep changes in Android itself, if I'm not mistaken? It's not something an application can choose on its own, but rather would be in the device's firmware, somewhere. -- 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
Re: [android-developers] A slightly altered pattern for extending the life span of a broadcast receiver (Not entirely verified yet)
What I find truly bizarre is that I was just thinking about trying to simplify the invocation of WakefulIntentService, about 20 minutes ago, before opening this email message. If you are inside my head, can I hire you to do a bit of cleaning while you are in there? :-) Satya Komatineni wrote: 1. Make the whole thing look like just a broad cast receiver and hide the service as much as possible with only one method exposed The problem here is that there are some system-provided BroadcastReceiver classes (e.g., AppWidgetProvider), and Java does not support mixins. Having ALongRunningReceiver is fine, but you also need an access path that does not assume the developer can extend ALongRunningReceiver every time. 2. Pass along the broadcast intent all the way to the receiving service method as if the service method is getting the broadcast intent. Cool concept. Are you just passing this as a Parcelable extra on the Intent used to start the service? 3. I have also taken a very slightly different approach to holding and releasing the locks with an extra release from the onDestroy of the service just in case (although unlikely) if the start and stop services don't coincide due to exceptions or errors in code As was recently discussed on [cw-android], there is also the reverse scenario. If the service is killed by the system while it is running (e.g., low memory), Android will start up the service again with the same Intent...but it will not have acquired the WakeLock. Then, when you release the WakeLock, it crashes with an under-locked exception. I committed code to WakefulIntentService a few days ago that addresses this scenario as best I can, by making sure that the WakeLock is acquired inside the service, almost like an assertion, early in onStart(). This is not a perfect solution, but it is the best I can come up with. BTW, to truly fully release the WakeLock in onDestroy() like you describe, you might have to make it setReferenceCounted(false) before calling release(). Otherwise, it may still be locked if, for whatever reason, multiple acquire() calls got leaked. I have not tried modifying setReferenceCounted() on an acquire()'d WakeLock. I am hesitant and suspect that this may be a fishy thought. Not at all. -- 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
[android-developers] setting theme for an activity
-- Warm Regards,Hi All, This is my themes.xml file resources style name=Theme.Blue parent=android:Theme item name=android:windowBackground@drawable/bodyimg_blue/item item name=android:colorBackground@color/royalblue/item item name=android:textColor@color/midnightblue/item item name=android:textViewStyle@style/TextViewBlue/item /style resources This is main activity code snippet public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout. main_screen); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Emulator TCP Packet Size
Has anyone tried to do a tcp client server app using the emulator using the pc as a server and the phone as the client? I've got a bit of an issue where its only sending one packet, ie 1491 bytes of data regardless of how much there actually is to send, from the client(Phone) to the server(PC) Thanks James -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android Dev Phone with 2.x?
Not in Czech Republic. Official price here is lower that in shop mentioned in your post. And again: it is not officially rooted! Contrary to phone I bought from Google couple moth ago. Tom On 5 čvn, 17:24, ko5tik kpriblo...@yahoo.com wrote: On Jun 4, 1:28 pm, Tomá¹ Hubálek tom.huba...@gmail.com wrote: In this case there is no chance in our country as Vodafone (as Nexus One distributor in Europe) said that they will not sell this phone in Czech Republic. I wish there would be ADP 3 as I like to have phone officially rooted (because of unofficially rooted phones lose warranty here). I bet that they: http://www.pdamax.de/ will be happy to ship unbranded HTC Desire to you. In any case better deal than branded and locked one from vodafone -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Home key - desired behaviour?
It would be more accurate to say that onStop is *supposed* to be called whenever HOME is pressed. In 2.1, this does not happen: http://code.google.com/p/android/issues/detail?id=6094#c0 Cheers, Steve On Jun 5, 7:59 pm, Mark Murphy mmur...@commonsware.com wrote: guich wrote: Thanks. I got that the onStop event is called when the home key is pressed. onStop() is called any time the activity is no longer visible. Hence, onStop() will be called for: -- HOME -- BACK -- you starting another activity -- the user choosing a notification from the drawer -- an incoming phone call -- etc. As a side question, is there a way to discover the name of the intent that called another intent? Like a stack trace of intents. No, sorry. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://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
[android-developers] Re: Is it possible to draw to a home screen icon?
I should add that you would have to get the launcher to update by broadcasting an intent with the action ACTION_PACKAGE_CHANGED. But that should be a general way to implement what Sense UI does by changing app icons. On Jun 5, 10:42 pm, Zigurd zigurd.medni...@gmail.com wrote: Try Live Wallpapers:http://developer.android.com/resources/articles/live-wallpapers.html App icons are not accessible outside the launcher. At best, you might be able to hack something by turning activity aliases on and off and changing an app icon that way. That is, you might have an second app icon that serves as a kind of notification, for example, and you could turn it on/off, or run through a sequence of icon variations, with PackageManager calls to enable/disable the component names corresponding to the aliases. But there is no way to borrow the Launcher's app icon views and draw into 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] GPS Min Time
Hi all, When using locationManager.requestLocationUpdates(provider, 3,1, locationListener);,,,it doesn't consider the time in consideration,,just it updates the location when I change the coordinates from the DDMS , What should I do just to make the updates periodically based on the time I specify -- tarek -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Home key - desired behaviour?
Flying Coder wrote: It would be more accurate to say that onStop is *supposed* to be called whenever HOME is pressed. In 2.1, this does not happen: http://code.google.com/p/android/issues/detail?id=6094#c0 That's not strictly accurate. Android 2.1 doesn't have a problem. The Launcher on the Nexus One does. Hence, the HTC Incredible and HTC EVO 4G do not have this problem. Neither does the Motorola DROID. I have updated the issue with this information. -- 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
[android-developers] GPS Min Time
Hi all, When using locationManager.requestLocationUpdates(provider, 3,1, locationListener);,,,it doesn't consider the time in consideration,,just it updates the location when I change the coordinates from the DDMS , What should I do just to make the updates periodically based on the time I specify -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] GPS Min Time
Hi all, When using locationManager.requestLocationUpdates(provider, 3,1,locationListener);,,,it doesn't consider the time in consideration,,just it updates the location when I change the coordinates from the DDMS , What should I do just to make the updates periodically based on the time I specify -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] GPS Min Time
Hi all, When using locationManager.requestLocationUpdates(provider, 3,1,locationListener);,,,it doesn't consider the time in consideration,,just it updates the location when I change the coordinates from the DDMS , What should I do just to make the updates periodically based on the time I specify -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] GPS Min Time
Hi all, When using locationManager.requestLocationUpdates(provider, 3,1,locationListener);,,,it doesn't consider the time in consideration,,just it updates the location when I change the coordinates from the DDMS , What should I do just to make the updates periodically based on the time I specify -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Free and paid version share same data
Andreas, If you are using Eclipse, you may wish to consider setting up a library project, since that was designed for the paid/free app scenario: http://www.google.com/url?sa=Dq=http://developer.android.com/guide/developing/eclipse-adt.html%23libraryProjectusg=AFQjCNGHPeZv-40aHFJUElKIwdatQMjx_A -Moto On Jun 5, 5:16 pm, andreas andreas.str...@googlemail.com wrote: I have a free app in the market and use the data directory of the app to store some files. Now I think about offering a paid (donate) version of the app, so that people who want to pay a few pennys will be able to do so. But AFAIK the new (paid) app needs a new name, so I won't be able to use the stored data of the free version. That means, that existing users would have to re-enter a lot of personal settings - which probably would be a no-no for a lot of users. So my question: Is there a smart way to have a free and a paid version in the market, where the later installed payed version can use the data of the free version? I thought about using the SD-card for data storage, but there might be devices without any SD-card... Andreas -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Themes, Styles and Items [How to create skins for apps?]
Any help regards to Themes? Please see first and second post of this thread... I tried various things and have had no luck... :( Thanks! -Moto On Jun 2, 2:27 pm, Moto medicalsou...@gmail.com wrote: No idea what you mean about so what... The thing is I want my background to point to something like colorListItemBottom. Than each created Theme could change the color property of colorListItemBottom. On May 30, 10:37 am, helmi.mir...@gmail.com wrote: So what ? Powered by Telkomsel BlackBerry® -Original Message- From: Moto medicalsou...@gmail.com Sender: android-developers@googlegroups.com Date: Sun, 30 May 2010 07:33:10 To: Android Developersandroid-developers@googlegroups.com Reply-To: android-developers@googlegroups.com Subject: [android-developers] Re: Themes, Styles and Items [How to create skins for apps?] Bump?... On May 27, 6:57 pm, Moto medicalsou...@gmail.com wrote: example of declared Themes, note the changes in the pointing color... How do I use this than so that my view points to the item colorListItemBottom?? !-- Light Skin -- style name=Theme.Skin.DayTime item name=colorListItemBottom@color/color_semi_white/item /style !-- Dark Skin -- style name=Theme.Skin.NightTime item name=colorListItemBottom@color/color_semi_black/item /style On May 27, 6:51 pm, Moto medicalsou...@gmail.com wrote: I guess this is new topic... :( On May 27, 3:20 pm, Moto medicalsou...@gmail.com wrote: I'm currently trying to create skins for my app, and the simplest way to do it, it seems is by creatingThemesfor each skin. I'm getting confused with how to use a specified item which points to a declared color from my Theme to a particular shape I create via xml. I hope I make sense... Thanks for any help I can get! -Moto -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Close alertdialog.builder from an external button
The create method of the builder creates and returns a new dialog each time you call it. So when you do that you are creating a second dialog that hasn't been shown, then calling dismiss on it. If you used Activity#showDialog to show your dialog, then just use Activity#dismissDialog with the same ID parameter to dismiss it. Using these methods is called using managed dialogs, because the activity manages them for you. If you are not using managed dialogs, then keep a reference to the dialog when you first create it on your own. Save the result of the create method the first time you call it to a field and then call dismiss on that later. On May 27, 9:53 am, Lamia Hannoun lamia.hann...@gmail.com wrote: Hi! well it's all in the subject :) do u have any ideas about how to dismiss a builder from an external button. I did mybuilder.create().dismiss() inside the onclicklistener of the button. But it doesn't work. Thx 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
Re: [android-developers] Re: Multitasking on Android - Why So Incredibly Bad?
It's a constant in ActivityManagerService. You wouldn't want to just change it, because it could seriously impact responsiveness. The solution would be to have the activity manager be able to go on with the switch, but keep the application in foreground for longer, giving it a chance to respond with its state. On Sun, Jun 6, 2010 at 3:27 AM, Mark Murphy mmur...@commonsware.com wrote: Simon Broenner wrote: Is there a way to increase the time that the browser (and/or other apps) has to save its state? Probably only with very deep changes in Android itself, if I'm not mistaken? It's not something an application can choose on its own, but rather would be in the device's firmware, somewhere. -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Multitasking on Android - Why So Incredibly Bad?
Hello everyone! The solution (or rather, workaround) for me, so far, has been to root the device and move my apps to the SD card, freeing up more of the phone's internal memory. I now have around 60MB of free device memory (albeit with 200MB+ of apps installed), and have only been able to reproduce the problem once (tried about 10-15 times). Obviously this situation is still not ideal, but it's one I can live with. Hopefully the problem will more or less subside as device memory becomes larger and larger, and less and less applications need to be installed on the device memory itself due to Apps2SD being built in from Froyo onwards. Thank you all for your help! On Sun, Jun 6, 2010 at 6:11 PM, Dianne Hackborn hack...@android.com wrote: It's a constant in ActivityManagerService. You wouldn't want to just change it, because it could seriously impact responsiveness. The solution would be to have the activity manager be able to go on with the switch, but keep the application in foreground for longer, giving it a chance to respond with its state. On Sun, Jun 6, 2010 at 3:27 AM, Mark Murphy mmur...@commonsware.comwrote: Simon Broenner wrote: Is there a way to increase the time that the browser (and/or other apps) has to save its state? Probably only with very deep changes in Android itself, if I'm not mistaken? It's not something an application can choose on its own, but rather would be in the device's firmware, somewhere. -- 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Simon Broenner -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 make a widget that doesn't drain the battery and updates often
I have two observations/question to supplement what others have already observed: 1)5 seconds may just be too often: if I had such a widget on my phone, I would prefer updating every 30 seconds, not every 5: but in fact, when I find widgets doing such self-updates I generally uninstall them.. 2) you should go ahead and use wake_locks yourself -- not to seize resources and turn them on, but to do the opposite: relinquish screen and network and allow them to go off -- unless someone else's wake_lock is the real culprit keeping them on. But it it is someone else's that is the culprit there is little you can do: the best you can do is to make the updates infrequent as I already suggested. Finally, the update period is an obvious candidate for a Preferences Menu. On Jun 5, 11:38 am, Chister Nordvik cnord...@gmail.com wrote: Frankly, I don't know why the Genie... service sticks around for the stock News and Weather. It does not appear to be affecting the thoroughly irritating and non-configurable change-the-headline-every-five-seconds feature, as that persists even when I shut down the service via the Settings application. Neither do I, but it seems everyone is taking this approach. I really really miss guidelines on Android development. Both GUI design guidelines (toolbars at the bottom anyone?) and design guidelines for widgets doing more advanced things than updating a clock. It must be 100 different toolbars out there at the moment in various sizes. Why can't we have a proper toolbar in Android? Sorry, off-topic :-) So is this really the best solution to have a service running in the background? Probably not. I would love to see some better suggestions :-) If you are using a WakeLock, double-check to confirm you are releasing it properly. No wake-locks. Only using the following code to make the widget change headline: ... am.set(AlarmManager.RTC, System.currentTimeMillis() + 5000, pendingIntent); ... According to the documentation this should work just brilliant. But my phone is dead every morning with my widget running. Uninstalled! ... to see who is messing up. Well, people will blame my widget even if I try to tell them that they have another application that has wake_locks so I must make my widget behave nicely with the rest of the apps out there. Well I have made a new service that runs all the time and receives broadcast events for screen off and on and that works great, so maybe I'll stick with this. When I have started 10 of my favourite apps I have a lot of services running so I guess people are used to this. Seems like services is a bit overused these days so no wonder everyone complains about battery life with Android... -Christer -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Calling wait in AsyncTask (e.g. inside doInBackground) raises IllegalMonitorStateException
While the others who responded gave you good advice, and also touched on what I'm about to tell you, I'd like to direct your attention to the documentation for the wait() call. The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method. The thread then waits until it can re-obtain ownership of the monitor and resumes execution. This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor. Throws: IllegalMonitorStateException - if the current thread is not the owner of the object's monitor. Now, if you haven't read the documentation for the method, you're clearly not presently prepared to take on Java threading. That's not a problem, I'm just emphasizing you should follow the advice, and avoid writing thread-based synchronization yourself unless absolutely necessary (and if it really is necessary, be sure you understand it well, and test it well). It's not enough to know the primitives like wait and notify, or the concurrency package. You also need to know very specific usage patterns to reliably get the result you want. And then, knowing them, you have to actually do them correctly. And on a project with other people, hope they don't later screw them up. Where I'm going with this is -- any effort you were thinking of putting into learning how to use wait() / notify() is probably better spent in figuring out how NOT to use them, but something higher level instead. For example, with if you are using a producer/consumer pattern, why not use a LinkedBlockingQueue to communicate between them? If the consumer goes blocked, then the producer can continue working, up to some limit, resulting in better throughput. Yes, you can use notify/ wait to implement this -- and yes, it's not really all that hard to do, if you know what you're doing. But it's a whole lot clearer without the queuing implementation being part of your program. One thread starts up and stuffs things into the queue in a loop. The other thread starts up and reads things from the queue in a loop. Easy to write, and easy to read. The tricky part, though, is handling when the threads should go away, in event of an error on the other side. A flag per side and synchronize can tell each side to exit its loop, but making sure that if one side exits abnormally while the other side is waiting on it, that the other side is not left hanging, is harder. On the receive side you have to drain the queue so the sender side can return from the put() call. On the send side, you have to put something distinct so the receiver will return from the take() call, and notice that the sender has gone a way. To my mind, this is a design failure of the java.util.concurrent package. There should be a abort() method on all the blocking objects, which causes anything waiting on it to throw an unchecked exception. Then this simple pattern would suffice: // Queue for both sides LinkedBlockingQueueMyElt q = new LinkedBlockingQueueMyElt(CAPACITY); ... boolean ok = false; try { doSomething(q); ok = true; } catch (QueueAborted e)( // The other side exited -- silently ignore, or do any needed cleanup. } finally { if (! ok) q.abort(); } But no, we have to put a fair bit of code in both the finally clause, and the doSomething() method. Worse, it's different on each side As you can see, even using the java.util.concurrent package, there's a fair amount of subtlety. I don't see these issues handled correctly very often, I'm afraid. Unlike Mark, I don't assume Doug Lea is smarter than I am (though he could be). But experience and the laws of probability show that the odds of my getting it right ALL the time are extremely low, no matter HOW smart I am. The Android designers put a fair amount of thought and effort into making it possible to avoid threading pitfalls. But I think they need to revisit the issue, and capture a few more of the patterns -- such as this one. There's already a way to do this in Android, BTW, but it requires a bit of a shift in thinking. Handler's already queue and consume. Take the inside of your loop in your receiver's doSomething() (let's call it doOneThing(item) ) -- and post it to a Handler. You'll probably want to hook the Handler to a separate HandlerThread. That all works; the main problem I have with it is that it's a bit too complex to set up for this use, and it requires too much of a rethink, so people don't do it this way, but ask threading questions instead. It also may require some rethinking to avoid creating a new Runnable() object at each step. But it's there, and using facilities like this are how you should be thinking. On Jun 5, 1:19 pm, Ali Chousein ali.chous...@gmail.com wrote: Hi, I
[android-developers] Re: GPS/LocationManager does not give a fix in my app
Still haven't found a way to make it work. If someone has a clue please let me know. Thank you! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Free and paid version share same data
Hi Moto, thanks, that sounds interesting. But if I get it right, I will still build two different apps with different names and therefore different storage locations in data/. Or am I wrong? Andreas On 6 Jun., 17:03, Moto medicalsou...@gmail.com wrote: If you are using Eclipse, you may wish to consider setting up a library project, since that was designed for the paid/free app scenario: http://www.google.com/url?sa=Dq=http://developer.android.com/guide/d... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] The Lunar Lander bug
This bug seems to be quite famous, if you do a Google search on it. However, I still can't find the solution to it. After all this time, and after several android version releases, the bug still exists and no one has bothered to update it. Here's one website which offers a solution (and I've seen the same solution offered elsewhere...): http://android-er.blogspot.com/2010/06/illegalthreadstateexception-in.html The solution is said to be to move the code: thread = new MySurfaceThread(getHolder(), this); ...from constructor of the SurfaceView to inside the surfaceCreated() method. Well I've tried it, and it just causes me further bugs, and before I know it I've got the code into a right mess trying to figure it out. If anyone can shed any light on this, and offer the code which sorts this example out once and for all, I for one would be very grateful :-) ps. The bug is where you press the 'home' key during play, and then return to the game, because you can't call thread().start twice. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Is it possible to draw to a home screen icon?
On Sun, Jun 6, 2010 at 6:44 AM, Zigurd zigurd.medni...@gmail.com wrote: I should add that you would have to get the launcher to update by broadcasting an intent with the action ACTION_PACKAGE_CHANGED. You should not send this kind of broadcast. In fact in newer platforms you can't. But that should be a general way to implement what Sense UI does by changing app icons. Sense UI probably has some special cases hard-coded in to things. Being able to change app icons is something we'd like to do at some point, but has been a lower priority than many other things. I don't know when it may happen. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Multitasking on Android - Why So Incredibly Bad?
Um, internal storage has very little to do with available RAM. In fact apps on the SD card use a little more RAM than those in internal storage. So this solution is just happening to do something as a side-effect... maybe things are paging slightly faster because the SD card is faster than internal storage, so the browser isn't as slow to save its state. On Sun, Jun 6, 2010 at 9:18 AM, Simon Broenner simonbroen...@gmail.comwrote: Hello everyone! The solution (or rather, workaround) for me, so far, has been to root the device and move my apps to the SD card, freeing up more of the phone's internal memory. I now have around 60MB of free device memory (albeit with 200MB+ of apps installed), and have only been able to reproduce the problem once (tried about 10-15 times). Obviously this situation is still not ideal, but it's one I can live with. Hopefully the problem will more or less subside as device memory becomes larger and larger, and less and less applications need to be installed on the device memory itself due to Apps2SD being built in from Froyo onwards. Thank you all for your help! On Sun, Jun 6, 2010 at 6:11 PM, Dianne Hackborn hack...@android.comwrote: It's a constant in ActivityManagerService. You wouldn't want to just change it, because it could seriously impact responsiveness. The solution would be to have the activity manager be able to go on with the switch, but keep the application in foreground for longer, giving it a chance to respond with its state. On Sun, Jun 6, 2010 at 3:27 AM, Mark Murphy mmur...@commonsware.comwrote: Simon Broenner wrote: Is there a way to increase the time that the browser (and/or other apps) has to save its state? Probably only with very deep changes in Android itself, if I'm not mistaken? It's not something an application can choose on its own, but rather would be in the device's firmware, somewhere. -- 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Simon Broenner -- You received this message because you are subscribed to the Google Groups Android Developers group. 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Multitasking on Android - Why So Incredibly Bad?
Hello Diane! I think you've misunderstood me somewhat. The problem doesn't seem to be that there isn't enough RAM available - that's a given already (because I know I'm using way too much RAM with all my open browser windows), and the process will be stopped anyway, no matter what I do. The thing is, I'm guessing that WHEN the browser is closed, the browser state is saved in the phone internal storage (which is what I've been talking about this whole time - maybe I just haven't been clear enough in that respect - any time I don't explicitly say RAM when I'm talking about memory, I'm talking about the phone's internal application storage and _not_ the RAM), and the browser's state would require more space than the phone storage currently has available. That would at least explain the symptoms I've been having, and the fact that the workaround, well, works. On Sun, Jun 6, 2010 at 8:42 PM, Dianne Hackborn hack...@android.com wrote: Um, internal storage has very little to do with available RAM. In fact apps on the SD card use a little more RAM than those in internal storage. So this solution is just happening to do something as a side-effect... maybe things are paging slightly faster because the SD card is faster than internal storage, so the browser isn't as slow to save its state. On Sun, Jun 6, 2010 at 9:18 AM, Simon Broenner simonbroen...@gmail.comwrote: Hello everyone! The solution (or rather, workaround) for me, so far, has been to root the device and move my apps to the SD card, freeing up more of the phone's internal memory. I now have around 60MB of free device memory (albeit with 200MB+ of apps installed), and have only been able to reproduce the problem once (tried about 10-15 times). Obviously this situation is still not ideal, but it's one I can live with. Hopefully the problem will more or less subside as device memory becomes larger and larger, and less and less applications need to be installed on the device memory itself due to Apps2SD being built in from Froyo onwards. Thank you all for your help! On Sun, Jun 6, 2010 at 6:11 PM, Dianne Hackborn hack...@android.comwrote: It's a constant in ActivityManagerService. You wouldn't want to just change it, because it could seriously impact responsiveness. The solution would be to have the activity manager be able to go on with the switch, but keep the application in foreground for longer, giving it a chance to respond with its state. On Sun, Jun 6, 2010 at 3:27 AM, Mark Murphy mmur...@commonsware.comwrote: Simon Broenner wrote: Is there a way to increase the time that the browser (and/or other apps) has to save its state? Probably only with very deep changes in Android itself, if I'm not mistaken? It's not something an application can choose on its own, but rather would be in the device's firmware, somewhere. -- 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Simon Broenner -- You received this message because you are subscribed to the Google Groups Android Developers group. 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 -- 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
[android-developers] AutoCompleteTextView and SimpleCursorAdapter
Hi All, I'm using AutoCompleteTextView with SimpleCursorAdapter. It works properly except one issue: I can't get regular list dropdown view. When performing filtering the lines are narrow. I've tested API Demos AutoCompelte1 example and got the normal dropdown view when using ArrayAdapterString. Is there any standard way to show normal dropdown view? Please advise what is wrong or what I've missed there. Thans a lot, Evgeny The source code is following: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MyAdapter adapter = new MyAdapter(this, android.R.layout.simple_spinner_item, null, new String[] {name}, new int[] {android.R.id.text1}); AutoCompleteTextView autoCompleteCountry = (AutoCompleteTextView)findViewById(R.id.txtCountry); autoCompleteCountry.setAdapter(_adapter); // autoCompleteCountry.setDropDownHeight(LayoutParams.FILL_PARENT); // adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line); adapter.setStringConversionColumn(1); } private class MyAdapter extends SimpleCursorAdapter { public MyAdapter(Context context, int layout, Cursor c, String[] from,int[] to) { super(context, layout, c, from, to); } @Override public Cursor runQueryOnBackgroundThread(CharSequence constraint) { if(constraint == null || constraint.length() == 0) return super.runQueryOnBackgroundThread(constraint); return myB.rawQuery(select country._id _id, country.name_en name from country where name_en like ' + constraint.toString().replace(', '') + %', null); } } } ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent ScrollView android:id=@+id/ScrollView01 android:layout_width=fill_parent android:layout_height=fill_parent LinearLayout android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/lblCountry android:layout_width=fill_parent android:text=@string/lblCountryFrom android:layout_height=fill_parent/ AutoCompleteTextView android:id=@+id/txtCountry android:layout_width=fill_parent android:layout_height=wrap_content /AutoCompleteTextView /LinearLayout /ScrollView /LinearLayout -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Bitmap memory handling with ImageView.setimage
While creating a bitmap, you should probably scale down the image size. This is how you should do it. BitmapFactory.Options bmpFactory = new BitmapFactory.Options(); bmpFactory.inSampleSize = 4; Bitmap bmp = BitmapFactory.decodeFile(path, bmpFactory); The sample size 4, will scale down the bitmap to 1/4 of the original size. This will, in turn, reduce the size of the Bitmap object by a factor of 4. Hope this helps. Thanks and Regards, Kumar Bibek On Jun 5, 3:22 am, Nathan critter...@crittermap.com wrote: I've read a lot of previous messages on this topic but couldn't find universal agreement on the whole. I can't reproduce this in house, but a customer got an OutOfMemoryError when using an icon chooser dialog. This dialog is much like the Grid1 example - only it's in a dialog. The bitmap memory seems to run out after running the dialog a few times for a customer, resulting in java.lang.OutOfMemoryError: bitmap size exceeds VM budget public View getView(int pos, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(mContext); //imageView.setLayoutParams(new GridView.LayoutParams(40, 40)); imageView.setAdjustViewBounds(false); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(4, 4, 4, 4); } else { imageView = (ImageView) convertView; } imageView.setImageResource(idlist.get(pos).value); imageView.setTag(idlist.get(pos).key); return imageView; } Should I try to call recycle on the bitmap from an ImageView when I reuse the view? Or would the ImageView do that anyway? But even if I do that, that's only a small portion of the bitmaps because most of them are seen without scrolling. The Adapter and the GridView are both local variables and therefore shouldn't be referenced after the dialog is dismissed. I do believe that it should be possible to use many bitmaps in an app - Google Maps does it, Picture Gallery does it. But maybe I need to learn more rules. Some say you should call bitmap.recycle, some say you shouldn't have to. Many say calling gc.collect will make it worse, etc. Nathan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Open native Maps with directions??
AFAIK this feature is not available yet with the Google Maps App for Android. The docs will get updated, hopefully when it is available. http://developer.android.com/guide/appendix/g-app-intents.html Thanks and Regards, Kumar Bibek On Jun 4, 5:02 pm, guruk ilovesi...@gmail.com wrote: Hi, I open my Native Google Maps like: Uri uri = Uri.parse(geo:0,0?q=Boston); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); That works fine! BUT... how to open it with a direction request like q=Boston+to:+Washington that works fine in google mapshttp://maps.google.com/?q=boston+to:+washington but doesnt do anything when I try to do the same with the native App on my Android Device!? thx chris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: select text in Edittext box
If something is not selected, then you would get zeros. So, try selecting some text and check. Thanks and Regards, Kumar Bibek On Jun 3, 1:22 pm, Manu manubharg...@gmail.com wrote: whenever i use the methods getselectionstart and getselectionend on a edittext widget ,i get both the integers equal to zero,could anyone please help me. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Display Widget inside activity?
You can at the most use the layout of the widget and the update code. Other than that, I guess, you cannot bring the widget as it is on your activity. A widget has a lifecycle of it's own. Thanks and Regards, Kumar Bibek On Jun 3, 12:37 am, Tommy droi...@gmail.com wrote: Hey everyone, I was wondering if there is a way to show a widget that I have created inside an activity. I have a weather widget and I also have an app I am working on that I would like to include weather reports in. Is there a way I can just re-use the widget code and make it show inside the weather activity? Thanks for your time and help, Tommy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: GPS Min Time
Hi there! I have a lot of truble with the GPS on emulator. I think it is not work correctly, so if you have a chance try to use a real phone ! Bye: Karoly On jún. 6, 16:13, tarek attia tarek.m.at...@gmail.com wrote: Hi all, When using locationManager.requestLocationUpdates(provider, 3,1, locationListener);,,,it doesn't consider the time in consideration,,just it updates the location when I change the coordinates from the DDMS , What should I do just to make the updates periodically based on the time I specify -- tarek -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Calling wait in AsyncTask (e.g. inside doInBackground) raises IllegalMonitorStateException
Guys, thank you all for your suggestions and comprehensive explanation. I think LinkedBlockingQueue sounds the most attractive way to go. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Calling wait in AsyncTask (e.g. inside doInBackground) raises IllegalMonitorStateException
By the way, guys, below please find my code. I was trying to use wait() inside synchronization. I have the same logic working perfectly fine in the scenario when the main thread cancels an AsyncTask and waits for it to finish. Whether there will be deadlock or not, depends on the implementation mistakes I think. synchronized(mContext) { if (mContactsMessages.isEmpty()) { mConsumerThreadWaitingForMessages = true; while(mConsumerThreadWaitingForMessages) { try { this.wait(); } catch (InterruptedException e) { // Do nothing! } } } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Android to Windows ICS (Internet Connection Sharing) via WiFi
Is it possible for Android to connect to Windows ICS (Internet Connection Sharing) via WiFi? I have set up Windows ICS (Internet Connection Sharing) on my Windows XP laptop WiFi adapter. The connection is open with WEP disabled. From a Windows Mobile 6 PDA I am able to see various WiFi routers, my laptop ICS and connect to the laptop ICS. From Android I am only able to see the various WiFi routers, but not the laptop ICS connection. Does the Windows ICS use some special Microsoft protocol that the Android WiFi adapter can not detect? Is there some other Android software or app that can connect the Windows WiFi ICS? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Using Android Calendar ContentProvider.
Jose Luis Montes jlmontesj at gmail.com writes: The answer is here. http://www.mail-archive.com/android-developers@googlegroups.com/msg97352.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Android to Windows ICS (Internet Connection Sharing) via WiFi
Is the SSID visible? 07.06.2010 0:40 пользователь Tim t...@mobiforms.com написал: Is it possible for Android to connect to Windows ICS (Internet Connection Sharing) via WiFi? I have set up Windows ICS (Internet Connection Sharing) on my Windows XP laptop WiFi adapter. The connection is open with WEP disabled. From a Windows Mobile 6 PDA I am able to see various WiFi routers, my laptop ICS and connect to the laptop ICS. From Android I am only able to see the various WiFi routers, but not the laptop ICS connection. Does the Windows ICS use some special Microsoft protocol that the Android WiFi adapter can not detect? Is there some other Android software or app that can connect the Windows WiFi ICS? -- You received this message because you are subscribed to the Google Groups Android Developers group. 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] Why is Android so buggy?
It seems that Android is very buggy compared not only to the iPhone, but to pretty much any other software. It's not just minor bugs either - pretty much every developer will come across many serious bugs. Some examples: - When you run the sdk setup.exe, the very first thing that happens is that it informs you that it can't connect using https, so you have to change the options to use 'http' instead. This appears to be a bug in the .exe rather than any kind of user issue because the https url works fine in the browser and this error seems to affect everyone. Sure, it's trivial to work around (just do a google search and you figure it out in 5 seconds), but the user shouldn't have to do that. It makes it look unprofessional. - When you view a TabWidget in the layout editor it crashes. - Every time you run an app in the emulator, it starts off with the screen locked so you need to press the Menu key. - Various socket bugs (or perhaps all the same bug) related to IOException not happening. Even something as simple as just trying to connect to a remote host that is not listening will cause it to hang instead of immediately returning an error. All of these bugs have been logged for months (some by me, some by other people) with no indication of any fix. At the moment I'm just using the emulator, but I'm wondering if the phones themselves are this buggy or if all the bugs are just in the development environment and emulator. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 it possible to draw to a home screen icon?
If you can't send ACTION_PACKAGE_CHANGED, how are alternative markets/ installers supposed to work? While it looks like if you sent ACTION_PACKAGE_ADDED the same thing would happen, based on the filter Launcher sets up, that seems less correct. I agree that Sense UI probably has some cooperating mechanism between their launcher and their apps. I was experimenting with activity aliases as a way of turning on and off the ability to launch into multiple different activities in the same app. Is that still kosher? I replied here because it seems that you could use the same technique to change icons. On Jun 6, 2:40 pm, Dianne Hackborn hack...@android.com wrote: On Sun, Jun 6, 2010 at 6:44 AM, Zigurd zigurd.medni...@gmail.com wrote: I should add that you would have to get the launcher to update by broadcasting an intent with the action ACTION_PACKAGE_CHANGED. You should not send this kind of broadcast. In fact in newer platforms you can't. But that should be a general way to implement what Sense UI does by changing app icons. Sense UI probably has some special cases hard-coded in to things. Being able to change app icons is something we'd like to do at some point, but has been a lower priority than many other things. I don't know when it may happen. -- 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] Motion Detection using camera?
Is this possible? How do i do it? I want to learn but dont know where to begin even :/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Why is Android so buggy?
I am not sure about the emulator menu button to unlock it being a bug... The one bug that really bothers me is the multi touch issue on different devices. I am not sure if it's been resolved, but last I read, it was impossible to make games with multi-touch controls due to an issue where after releasing the first touch point, then touching again it would register as the second touch point. From what I recall, someone on the android team said it was a hardware issue, yet, it appears on at least three different hardware platforms. I would think that would garner some major interest and a fix in 2.2 at the very latest, but not sure if it was or not. Still waiting for my 2.2 update for my moto droid. Supposedly sometime this month, but I am guessing next year before 2.2 gets released by Verizon. On Sun, Jun 6, 2010 at 2:25 PM, blahblah...@gmail.com blahblah...@gmail.com wrote: It seems that Android is very buggy compared not only to the iPhone, but to pretty much any other software. It's not just minor bugs either - pretty much every developer will come across many serious bugs. Some examples: - When you run the sdk setup.exe, the very first thing that happens is that it informs you that it can't connect using https, so you have to change the options to use 'http' instead. This appears to be a bug in the .exe rather than any kind of user issue because the https url works fine in the browser and this error seems to affect everyone. Sure, it's trivial to work around (just do a google search and you figure it out in 5 seconds), but the user shouldn't have to do that. It makes it look unprofessional. - When you view a TabWidget in the layout editor it crashes. - Every time you run an app in the emulator, it starts off with the screen locked so you need to press the Menu key. - Various socket bugs (or perhaps all the same bug) related to IOException not happening. Even something as simple as just trying to connect to a remote host that is not listening will cause it to hang instead of immediately returning an error. All of these bugs have been logged for months (some by me, some by other people) with no indication of any fix. At the moment I'm just using the emulator, but I'm wondering if the phones themselves are this buggy or if all the bugs are just in the development environment and emulator. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Is it possible to draw to a home screen icon?
I don't doubt that there's some cost to running an app that keeps drawing to a widget window. But it shouldn't be any worse than running a live wallpaper, should it? I assume the widget would get notified when it's not visible and get the chance to stop animating - just like a live wallpaper's supposed to do. Is that not true? In any case, I'd probably turn the animations on and off whenever you touch the widget. By the way, I'm not talking about tweening or any of the other built- in Android animations. I just want to draw frames to a bitmap and load them to a surface view that maps to the widget 'window' (which I'm hoping is a thing that looks like just another launcher on the home screen). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Is it possible to draw to a home screen icon?
Rob Y. wrote: I don't doubt that there's some cost to running an app that keeps drawing to a widget window. But it shouldn't be any worse than running a live wallpaper, should it? There can only be one live wallpaper at a time, AFAIK. There can be many app widgets at a time. A technique that works well for one may not work well for a dozen. I assume the widget would get notified when it's not visible and get the chance to stop animating - just like a live wallpaper's supposed to do. Is that not true? No, it is not true, at least not today. App widgets update independently of whether they are visible, and hence are not supposed to update very frequently. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Can't grok Activity life cycle.
I am having a really hard time grokking the Activity life cycle concept. The main issue is with onStop() and onDestory() not being guaranteed to be called before the process is killed. I though I had it figured out when I saw that the system calls onSaveInstanceState() when it's shutting down the activity to claim some memory. Thing is that the docs says onSaveInstanceState() will be called before onPause() but how does the system know at this point whether the activity will be killed by the system or the user? Here is a use case: 1) My activity starts up and is running. 2) At some point I want to show a web page so I use an Intent to start an activity. 3) The web browser covers my app/activity so I would expect onPause() to be called followed by onStop(). At this point it's my understanding that all bets are off and I can be killed at any point without be called. 4) Since the system has enough memory onSaveInstance() doesn't get called. 5) The user presses home and decides to open some app which requires a lot of memory. 6) System wants more memory and decides to kill my app but I am already stopped (onPause() has been called). What happens here? I am finding this a really serious problem since onPause() pretty much needs to be treated as onDestory() as far as I can tell. If my app has to be able to survive being killed without onStop() and onDestory() being called, why bother having them? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is it possible to draw to a home screen icon?
On Sun, Jun 6, 2010 at 2:30 PM, Zigurd zigurd.medni...@gmail.com wrote: If you can't send ACTION_PACKAGE_CHANGED, how are alternative markets/ installers supposed to work? While it looks like if you sent ACTION_PACKAGE_ADDED the same thing would happen, based on the filter Launcher sets up, that seems less correct. The system sends these when it installs or otherwise modifies packages. Alternative markets don't get to directly install apps (and at this level, neither does the regular market); they ask the system to, and it does the right thing. I was experimenting with activity aliases as a way of turning on and off the ability to launch into multiple different activities in the same app. Is that still kosher? I replied here because it seems that you could use the same technique to change icons. You could do this, but if the user has made a shortcut to your app this would break it. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is it possible to draw to a home screen icon?
On Sun, Jun 6, 2010 at 5:33 PM, Mark Murphy mmur...@commonsware.com wrote: Rob Y. wrote: I don't doubt that there's some cost to running an app that keeps drawing to a widget window. But it shouldn't be any worse than running a live wallpaper, should it? There can only be one live wallpaper at a time, AFAIK. There can be many app widgets at a time. A technique that works well for one may not work well for a dozen. Yep. And the whole management of the wallpaper is different -- it is directly managed by the window manager, which knows exactly when it is visible and not, and very carefully tells the wallpaper whenever it is not visible to keep it from wasting the battery. Widgets are much higher-level -- they don't even exist in their own window. In theory a widget host like Launcher could tell the system when any widgets that have been added to it are not visible, for that information to be propagated to the widget. However, this is a lot more complicated -- there can be multiple hosts, and the widget will need to correctly handle multiple instances potentially in multiple hosts. So there is a very good chance of a bug in many different places causing things to run when they shouldn't. Also, a bug in the host here would actually cause the battery use to be incorrectly attributed to the widget, and it would be very difficult to fix that. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Can't grok Activity life cycle.
Leigh McRae wrote: Thing is that the docs says onSaveInstanceState() will be called before onPause() No, it doesn't. In fact, it says just the opposite: If called, this method will occur before onStop(). There are no guarantees about whether it will occur before or after onPause(). http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle) but how does the system know at this point whether the activity will be killed by the system or the user? First, it doesn't matter in most cases. Second, onSaveInstanceState() may be called seconds or days before the process is killed, depending on what the user is doing. Third, the process is not typically killed. Usually, activities will be destroyed gracefully, going through onStop() and onDestroy(). A process termination is required only when there's an emergency need for RAM. Fourth, the system knows whether the user pressed the BACK button. Here is a use case: 1) My activity starts up and is running. 2) At some point I want to show a web page so I use an Intent to start an activity. 3) The web browser covers my app/activity so I would expect onPause() to be called followed by onStop(). Correct. At this point it's my understanding that all bets are off and I can be killed at any point without be called. Correct. Unlikely, but correct. 4) Since the system has enough memory onSaveInstance() doesn't get called. I have no idea where you came up with this. I would expect onSaveInstanceState() to have been called in this scenario, before onStop(), and around the time of onPause(). 5) The user presses home and decides to open some app which requires a lot of memory. 6) System wants more memory and decides to kill my app but I am already stopped (onPause() has been called). What happens here? Your app sees a bright light at the end of a tunnel, with the sound of harps in the background. Unless it's malware, in which case there's the strong odor of fire and brimstone. :-) I am finding this a really serious problem since onPause() pretty much needs to be treated as onDestory() as far as I can tell. If my app has to be able to survive being killed without onStop() and onDestory() being called, why bother having them? Because the process is generally not killed. That's like asking why we bother returning values from methods, because a method might raise a RuntimeException at any point, so why bother returning values? The reason we return values is because it's useful and random RuntimeExceptions are, er, the exception. Also, bear in mind that if your process is killed, a lot of cleanup you might ordinarily do in onStop() or onDestroy() (e.g., unregister listeners, stop threads) is no longer relevant. -- 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
Re: [android-developers] Re: Multiple notifications, single icon on notification bar?
On Jun 3, 2010 11:34 PM, Zsolt Vasvari zvasv...@gmail.com wrote: Can't you do what GMail does and shows the # of items in parantheses? On Jun 4, 8:51 am, TreKing treking...@gmail.com wrote: On Thu, Jun 3, 2010 at 5:30 PM, Mark Wyszomierski mar...@gmail.com wrote: Is there a way to ... TreKing - Chicago transit tracking app for Android-powered deviceshttp:// sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Developers ... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Setting theme in an activity
Try moving the setTheme(R.style.Theme_Blue) call to before the super.onCreate(savedInstanceState) call. On Jun 6, 1:55 am, Sudeep Jha sudeep.neti...@gmail.com wrote: Hi All, This is my themes.xml file resources style name=*Theme.Blue* parent=*android:Theme* item name=*android:windowBackground**...@drawable*/bodyimg_blue/item item name=*android:colorBackground*@color/*royalblue*/item item name=*android:textColor*@color/*midnightblue*/item item name=*android:textViewStyle*@style/TextViewBlue/item /style resources This is main activity code snippet *public* *void* onCreate(Bundle savedInstanceState) { *super*.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout. *main_screen*); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? Warm Regards, Sudeep -- Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 it possible to draw to a home screen icon?
Ow. Yeah, that would not be friendly to shortcuts. And I also see how alternative installers work, too, now that I looked into it. It appears that what I want to do would require an app downloading an update of itself and installing it in order to show a different set of launcher icons, and that's just not worth it to change the look of one icon on the fly. On Jun 6, 9:26 pm, Dianne Hackborn hack...@android.com wrote: On Sun, Jun 6, 2010 at 2:30 PM, Zigurd zigurd.medni...@gmail.com wrote: If you can't send ACTION_PACKAGE_CHANGED, how are alternative markets/ installers supposed to work? While it looks like if you sent ACTION_PACKAGE_ADDED the same thing would happen, based on the filter Launcher sets up, that seems less correct. The system sends these when it installs or otherwise modifies packages. Alternative markets don't get to directly install apps (and at this level, neither does the regular market); they ask the system to, and it does the right thing. I was experimenting with activity aliases as a way of turning on and off the ability to launch into multiple different activities in the same app. Is that still kosher? I replied here because it seems that you could use the same technique to change icons. You could do this, but if the user has made a shortcut to your app this would break it. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Can't grok Activity life cycle.
Thank you for such a detailed reply! On 6/6/2010 9:34 PM, Mark Murphy wrote: Leigh McRae wrote: Thing is that the docs says onSaveInstanceState() will be called before onPause() No, it doesn't. In fact, it says just the opposite: If called, this method will occur before onStop(). There are no guarantees about whether it will occur before or after onPause(). http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle) Looks like it says both :) Still whether it's before onPause() or onStop() doesn't matter much. To capture that state before the activity is killed, you can implement an ||onSaveInstanceState() http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState%28android.os.Bundle%29|| method for the activity. Android calls this method before making the activity vulnerable to being destroyed — that is, before |onPause()| is called. http://developer.android.com/guide/topics/fundamentals.html#lcycles but how does the system know at this point whether the activity will be killed by the system or the user? First, it doesn't matter in most cases. Second, onSaveInstanceState() may be called seconds or days before the process is killed, depending on what the user is doing. Third, the process is not typically killed. Usually, activities will be destroyed gracefully, going through onStop() and onDestroy(). A process termination is required only when there's an emergency need for RAM. Fourth, the system knows whether the user pressed the BACK button. For the BACK button that is trivial and very clear. What happens I launch the browser from my app and it covers my app as in my example. I would go through onPause() and onStop(). Both docs say that onSaveInstanceState() would have been called by now but the system doesn't know if it will run out of memory at some point with the browser. Similar would be when the user hits the HOME key and starts other apps. Here is a use case: 1) My activity starts up and is running. 2) At some point I want to show a web page so I use an Intent to start an activity. 3) The web browser covers my app/activity so I would expect onPause() to be called followed by onStop(). Correct. At this point it's my understanding that all bets are off and I can be killed at any point without be called. Correct. Unlikely, but correct. If it can happen it needs to be handled. 4) Since the system has enough memory onSaveInstance() doesn't get called. I have no idea where you came up with this. I would expect onSaveInstanceState() to have been called in this scenario, before onStop(), and around the time of onPause(). It's been inferred since the system has no way of knowing for SURE if it will have to kill the activity, at which time I have already been put in the background and received onStop(). Now for the trivial case where the system starts another activity and needs more memory it makes sense. 5) The user presses home and decides to open some app which requires a lot of memory. 6) System wants more memory and decides to kill my app but I am already stopped (onPause() has been called). What happens here? Your app sees a bright light at the end of a tunnel, with the sound of harps in the background. Unless it's malware, in which case there's the strong odor of fire and brimstone. :-) LOL. I am finding this a really serious problem since onPause() pretty much needs to be treated as onDestory() as far as I can tell. If my app has to be able to survive being killed without onStop() and onDestory() being called, why bother having them? Because the process is generally not killed. That's like asking why we bother returning values from methods, because a method might raise a RuntimeException at any point, so why bother returning values? The reason we return values is because it's useful and random RuntimeExceptions are, er, the exception. Also, bear in mind that if your process is killed, a lot of cleanup you might ordinarily do in onStop() or onDestroy() (e.g., unregister listeners, stop threads) is no longer relevant. -- Leigh McRae www.lonedwarfgames.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] Re: How to detect CPU Speed?
may I ask, why are trying to get the speed of the cpu? On Jun 5, 7:05 am, Martiño martino.figue...@gmail.com wrote: Is there a way of getting the speed at which the device is running? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Emulator TCP Packet Size
This may be unrelated but the Android emulator has a packet size limit of around 8K for UDP traffic. I tested it over a couple of wireless (WiFi) networks. On Jun 6, 7:17 am, jpspringall jpspring...@googlemail.com wrote: Has anyone tried to do a tcp client server app using the emulator using the pc as a server and the phone as the client? I've got a bit of an issue where its only sending one packet, ie 1491 bytes of data regardless of how much there actually is to send, from the client(Phone) to the server(PC) Thanks James -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Setting theme for an activity
Hi All, This is my themes.xml file resources style name=Theme.Blue parent=android:Theme item name=android:windowBackground@drawable/bodyimg_blue/item item name=android:colorBackground@color/royalblue/item item name=android:textColor@color/midnightblue/item item name=android:textViewStyle@style/TextViewBlue/item /style resources This is main activity code snippet public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Theme_Blue); setContentView(R.layout. main_screen); ... The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen. If I am setting the theme in android manifest file then it works properly. Can anybody tell me the reason for this? I also found this issue on google code android: http://code.google.com/p/android/issues/detail?id=3793 Warm Regards, Sudeep -- Warm Regards, Sudeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Why is Android so buggy?
I have spent my HTC magic for a year. So far, I am happy about that. On Mon, Jun 7, 2010 at 10:08 AM, Kevin Duffey andjar...@gmail.com wrote: I am not sure about the emulator menu button to unlock it being a bug... The one bug that really bothers me is the multi touch issue on different devices. I am not sure if it's been resolved, but last I read, it was impossible to make games with multi-touch controls due to an issue where after releasing the first touch point, then touching again it would register as the second touch point. From what I recall, someone on the android team said it was a hardware issue, yet, it appears on at least three different hardware platforms. I would think that would garner some major interest and a fix in 2.2 at the very latest, but not sure if it was or not. Still waiting for my 2.2 update for my moto droid. Supposedly sometime this month, but I am guessing next year before 2.2 gets released by Verizon. On Sun, Jun 6, 2010 at 2:25 PM, blahblah...@gmail.com blahblah...@gmail.com wrote: It seems that Android is very buggy compared not only to the iPhone, but to pretty much any other software. It's not just minor bugs either - pretty much every developer will come across many serious bugs. Some examples: - When you run the sdk setup.exe, the very first thing that happens is that it informs you that it can't connect using https, so you have to change the options to use 'http' instead. This appears to be a bug in the .exe rather than any kind of user issue because the https url works fine in the browser and this error seems to affect everyone. Sure, it's trivial to work around (just do a google search and you figure it out in 5 seconds), but the user shouldn't have to do that. It makes it look unprofessional. - When you view a TabWidget in the layout editor it crashes. - Every time you run an app in the emulator, it starts off with the screen locked so you need to press the Menu key. - Various socket bugs (or perhaps all the same bug) related to IOException not happening. Even something as simple as just trying to connect to a remote host that is not listening will cause it to hang instead of immediately returning an error. All of these bugs have been logged for months (some by me, some by other people) with no indication of any fix. At the moment I'm just using the emulator, but I'm wondering if the phones themselves are this buggy or if all the bugs are just in the development environment and emulator. -- You received this message because you are subscribed to the Google Groups Android Developers group. 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Regards, Michael Leung http://www.itblogs.info http://www.michaelleung.info -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] refresh gallery after saving photo in android
Hi, I have an application where I want to have the ability for the user to save one of the photos they are viewing to their phone locally. I got saving working, and now I want to automatically refresh so they don't have to turn off their phone before it shows up in the gallery. I googled around and saw this: sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(Environment.getExternalStorageDirectory().getAbsolutePath() ))); I tried doing that, but it didn't refresh for me. Does anyone have any ideas? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Asking for small QA on HTC Desire phone (Italy locale)
Hi All, I've reported some bug from HTC Desire phone running my app ConvertMe(Beta). Unfortunately I can't recreate in on emulator and on my G1. If you are Italian developer using HTC Desire, please download my app and test currency converter! Thanks in advance, Evgeny -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en