[android-developers] Downloads
Hi, Is there any way to get list of every downloads? It seems that DownloadManager returns downloads only for my app but I would like to get Market or Browser downloads too. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: App closed but notification is visible
Ok, so it is normal that when the system stops my app the notification is still visible but when I force close it then it disappears. Then my only problem is that my app isn't notified anymore about battery events. Maybe what I am doing is wrong: I register broadcast receivers in the onCreate method of my Application. And my app receive these events well for a long time, until my application stops somewhere. I don't know how to solve this problem: the updating (receiving event) should not be stopped until the user force closes my app. Is it not good to register receivers in the onCreate of my Application class? Should I use a service for it? A service is mandatory to receive these event always? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] RemoteViews + padding
Hi, Is there any way to set padding using RemoteViews? It would be fine if there were a method like remoteViews.setInt(viewId, setPadding, resourceId); or remoteViews.setInt(viewId, setPaddingLeft, resourceId); Tamás? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: RemoteViews + padding
Hi, Sorry, I mean I would like to change it runtime. It would be fine if my users could customize my widgets by changing paddings. So when I update my widges I would like to call remoteViews.setInt(viewId, setPadding, getIntPreference(padding)); or remoteViews.setViewPadding(viewId, getIntPreference(padding)); Can it be done somehow? Thanks, Tamás On Sep 22, 9:59 pm, Mark Murphy mmur...@commonsware.com wrote: You can specify it in the layout file you hand to the RemoteViews, but I don't see off the top how you would change it via Java code. On Thu, Sep 22, 2011 at 3:47 PM, b_t bartata...@gmail.com wrote: Hi, Is there any way to set padding using RemoteViews? It would be fine if there were a method like remoteViews.setInt(viewId, setPadding, resourceId); or remoteViews.setInt(viewId, setPaddingLeft, resourceId); Tamás? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] App closed but notification is visible
Hi, My application creates an ongoing notification that displays battery state and updates it when battery event occurs. Very rarely I notice that this notification doesn't change, doesn't display the correct value. When this happens my application isn't running but the notification is visible. This is very weird because when I force stop my app then the notification disappears too. I don't use any task killer apps so I think the system killed my app. Do you know how can it happen that my app is not running but the notification is visible and how to solve this problem? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: AppWidget Problems
Hi, It doesn't matter what you write in the updatePeriodMillis property if the value is too small because: Updates requested with updatePeriodMillis will not be delivered more than once every 30 minutes. You should use alarms to update your widget. Tamás On Sep 9, 10:51 pm, Chiara chiaradia.j...@gmail.com wrote: Hi, I'm working in a simple widget example but I cannot make it work. The Idea is to have a widget that updates it text with the current time every 30 seconds. The problem is that I only receive the onUpdate just when the widget is created. I'm using Android 2.2. here is the update method: @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.d(TAG, new Date().toLocaleString()); for (int widgetId : appWidgetIds) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.infoclima_widget); views.setTextViewText(R.id.text_last_update, new Date().toLocaleString()); appWidgetManager.updateAppWidget(widgetId, views); } } and here is the provider_info.xml: appwidget-provider xmlns:android=http://schemas.android.com/apk/res/android; android:minWidth=150dp android:minHeight=150dp android:updatePeriodMillis=3 android:initialLayout=@layout/infoclima_widget /appwidget-provider any on could help me? Regards, Chiara -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: External images in the notification area.
Nobody can help me? The external storage is available, device is not plugged at all. As I wrote external images is displayed in appwidgets but not in the notification area. I call: Uri imageUri = Uri.fromFile(file); remoteViews.setImageViewUri(imageViewId, imageUri); I haven't seen it before but now I can see that I got an exception: java.io.FileNotFoundException: (Permission denied) The file has the following permission: rwxr-x 1 system sdcard_r 8204 Aug 29 21:45 time.png And every parent directory: d---rwxr-x 3 system sdcard_r Any process should be able to read it, shouldn't? Tamás On Sep 7, 10:06 pm, rich friedel rich.frie...@gmail.com wrote: http://developer.android.com/guide/topics/data/data-storage.html#file... How are you gaining access to the external images? Are you sure that the files and storage actually are available to your application? Before you do any work with the external storage, you should always call getExternalStorageState()http://developer.android.com/reference/android/os/Environment.html#ge...() to check whether the media is available. If not, is the device plugged in with USB? Caution: External files can disappear if the user mounts the external storage on a computer or removes the media... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] External images in the notification area.
Hi, I have a problem I don't understand. In my app I try to create a notification with a RemoteViews to display some gui there. The layout contains an ImageView and I try to set an image via Uri, an image from the external storage. It works well on some devices with Android 2.3 and works well on my Xoom too with 3.2. But it doesn't work on other devices, doesn't work on my Desire with 2.3 too. It doesn't display the image. The same RemoteViews is ok when I use it to display appwidget. The image is displayed then. Do you know why it can't display the image and how to solve it? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: External images in the notification area.
The external storage is available, device is not plugged at all. As I wrote external images is displayed in appwidgets but not in the notification area. I call: Uri imageUri = Uri.fromFile(file); remoteViews.setImageViewUri(imageViewId, imageUri); I haven't seen it before but now I can see that I got an exception: java.io.FileNotFoundException: (Permission denied) The file has the following permission: rwxr-x1 system sdcard_r 8204 Aug 29 21:45 time.png And every parent directory: d---rwxr-x3 system sdcard_r Any process should be able to read it, shouldn't? Tamás On Sep 7, 10:06 pm, rich friedel rich.frie...@gmail.com wrote: http://developer.android.com/guide/topics/data/data-storage.html#file... How are you gaining access to the external images? Are you sure that the files and storage actually are available to your application? Before you do any work with the external storage, you should always call getExternalStorageState()http://developer.android.com/reference/android/os/Environment.html#ge...() to check whether the media is available. If not, is the device plugged in with USB? Caution: External files can disappear if the user mounts the external storage on a computer or removes the media... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Activity question
Hi, I have an app A and an app B. B has an activity called C. C can be displayed in two ways: - launch B which displays C - launch A and from A I start activity C Now C activity is displayed in two different task. What flag should I use when I start C from app A if I would like that C belongs to only B, not to A. I hope I was clear :) So I don't want that activity C could be displayed in two tasks in two different states. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Activity question
Now I don't use any flags just call startActivity. I don't know which flag should I use to get the expected result. On Jul 29, 9:18 pm, TreKing treking...@gmail.com wrote: On Fri, Jul 29, 2011 at 2:13 PM, b_t bartata...@gmail.com wrote: I have an app A and an app B. B has an activity called C. C can be displayed in two ways: - launch B which displays C - launch A and from A I start activity C How are you launching Activity C that belongs to App B from App A? --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] 9 patch png
Hi, I would like use a 9 patch png in an ImageView. It sounds easy but doesn't work for me. If I set the popup.9.png drawable as the source then the whole image is stretched, not works as I excepted. ImageView android:layout_width=fill_parent android:layout_height=fill_parent android:src=@drawable/popup/ If I set this drawable as background then it works well. But setting as background is not good for me because I would like to set alpha value too which is for source only not background. This link says too that you should set as background: http://stackoverflow.com/questions/5242880/android-9-patch-graphic-doesnt-scale-in-image-view Can somebody tell me why doesn't it work? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: 9 patch png
Hi, I think yes because it works well if I set as background. https://picasaweb.google.com/109616049711402953088/2011Julius22?authkey=Gv1sRgCK2eofOr_vCHkwE Here is the pictures: the nine patch png, the result with background/ setAlpha, the result with src/setAlpha. Stretching is ok in only one picture and alpha is ok in the other picture. Tamás On júl. 22, 10:23, Raghav Sood raghavs...@gmail.com wrote: Did you adjust the areas to be stretched properly? On Fri, Jul 22, 2011 at 1:49 PM, b_t bartata...@gmail.com wrote: Hi, I would like use a 9 patch png in an ImageView. It sounds easy but doesn't work for me. If I set the popup.9.png drawable as the source then the whole image is stretched, not works as I excepted. ImageView android:layout_width=fill_parent android:layout_height=fill_parent android:src=@drawable/popup/ If I set this drawable as background then it works well. But setting as background is not good for me because I would like to set alpha value too which is for source only not background. This link says too that you should set as background: http://stackoverflow.com/questions/5242880/android-9-patch-graphic-do... Can somebody tell me why doesn't it work? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Raghav Soodhttp://www.raghavsood.com/http://wiki.androidappcheck.com/http://www.telstop.tel/https://market.android.com/developer?pub=Raghav+Sood -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: 9 patch png
Hi, I have found the solution. If set scaleType=fitXY then it works. If I don't set then it doesn't work. On júl. 22, 10:37, b_t bartata...@gmail.com wrote: Hi, I think yes because it works well if I set as background. https://picasaweb.google.com/109616049711402953088/2011Julius22?authk... Here is the pictures: the nine patch png, the result with background/ setAlpha, the result with src/setAlpha. Stretching is ok in only one picture and alpha is ok in the other picture. Tamás On júl. 22, 10:23, Raghav Sood raghavs...@gmail.com wrote: Did you adjust the areas to be stretched properly? On Fri, Jul 22, 2011 at 1:49 PM, b_t bartata...@gmail.com wrote: Hi, I would like use a 9 patch png in an ImageView. It sounds easy but doesn't work for me. If I set the popup.9.png drawable as the source then the whole image is stretched, not works as I excepted. ImageView android:layout_width=fill_parent android:layout_height=fill_parent android:src=@drawable/popup/ If I set this drawable as background then it works well. But setting as background is not good for me because I would like to set alpha value too which is for source only not background. This link says too that you should set as background: http://stackoverflow.com/questions/5242880/android-9-patch-graphic-do... Can somebody tell me why doesn't it work? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Raghav Soodhttp://www.raghavsood.com/http://wiki.androidappcheck.com/http://www -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: 9 patch png
How do you mean? Simple call setBackgroundResource on View with a 9- patch image. On júl. 22, 14:34, arun kumar arun.kata...@gmail.com wrote: how to make background image as nine patch...can u guide 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: Xoom external storage
Oh, thank you. I completely misunderstood it before. On júl. 16, 18:20, Mark Murphy mmur...@commonsware.com wrote: On Sat, Jul 16, 2011 at 12:15 PM, b_t bartata...@gmail.com wrote: Can somebody explain something aboutXoom? I would like to getexternalsd path There is no such concept in Android as externalsd path. but it returns the internal storage as /mnt/sdcard No, that isexternalstorage.Externalstorage does not mean can be physically removed by the user without requiring a soldering iron.Externalstorage means can be mounted as a drive or volume on a host machine when the device is connected via USB. The real sd path is /mnt/external1 but I can't get it from the Api. There is no API to get an sd path. Device manufacturers will declare something to beexternalstorage. On older devices, this tends to be an SD card. On newer devices, this tends to be on-board flash. Newer devices withexternalstorage as on-board flash may also have some form of SD card slot; there is no API means of getting a path to that SD card slot or determining its state (e.g., is there media in it). Is it a bug inXoomfirmware? No. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Xoom external storage
Hi, Can somebody explain something about Xoom? I would like to get external sd path but it returns the internal storage as /mnt/sdcard The real sd path is /mnt/external1 but I can't get it from the Api. Is it a bug in Xoom firmware? I have Android 3.2. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: BackupAgent
hi, the interesting lines: Backup Manager is enabled / not provisioned / not pending init Auto-restore is enabled Last backup pass: 0 (now = 1307859545705) next scheduled: 0 Available transports: * com.google.android.backup/.BackupTransportService android/com.android.internal.backup.LocalTransport Pending init: 0 Participants: ... Ancestral packages: 8 ... Ever backed up: 0 Pending backup: 65 ... There are a lot of pending backups. On jún. 11, 18:09, dan raaka danra...@gmail.com wrote: see what you find here... $ adb shell dumpsys backup -Dan On Fri, Jun 10, 2011 at 5:07 AM, b_t bartata...@gmail.com wrote: Thank you for your response. All of these options are enabled in my phone but backup still doesn't work. Maybe the problem is about my ROM, I don't know On Jun 10, 1:14 pm, Kostya Vasilyev kmans...@gmail.com wrote: Ok, here is some info: http://developer.android.com/guide/topics/data/backup.html#Testing Ensure that backup is enabled - If using the emulator, you can enable backup with the following command from your SDKtools/ path: adb shell bmgr enable true - If using a device, open the system *Settings*, select *Privacy*, then enable *Back up my data* and *Automatic restore*. - ( strangely enough, my Xperia Arc running 2.3.3 doesn't have this setting under Privacy but a Galaxy S does ) -- Kostya 2011/6/10 Kostya Vasilyev kmans...@gmail.com I remember there being some kind of user setting when configuring a new phone. Can't say exactly what it is, might be the second from the top under Accounts and Sync in Settings. -- Kostya Vasilyev 10.06.2011 13:01 пользователь b_t bartata...@gmail.com написал: If I wipe user data when I start emulator then backup works. There is a setting or something that can disable backup process? What should I do to work it on my phone too? On Jun 10, 10:35 am, b_t bartata...@gmail.com wrote: Hi, I'm trying to implement BackupAgent functionality but I have no luck. It works well in emulator 2.2 but doesn't in emulator 2.3, 2.3.3 or in my device with 2.3.3. In 2.3.x it just displays when I run bmgr backup run in adb shell: 06-10 10:25:39.263: DEBUG/AndroidRuntime(14616): Calling main entry com.android.commands.bmgr.Bmgr 06-10 10:25:39.273: DEBUG/AndroidRuntime(14616): Shutting down VM In 2.2 emulator everything is ok! Do you have any idea? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: One of my apps no longer appears in searches, or under my apps public page?
My apps disappeared too. :( What is going on? On Jun 11, 1:51 am, Kostya Vasilyev kmans...@gmail.com wrote: Mine stopped appearing in searches by name. Will try to make a dummy change as well. -- Kostya Vasilyev 11.06.2011 8:03 пользователь Mark Wyszomierski mar...@gmail.com написал: Quick update - I thought maybe somehow my app got dropped from google's end, so I just modified a few characters of my app description and saved. Now it at least appears in direct searches in marketplace. Still doesn't show up its old search terms, or under my accounts page. Sigh. On Jun 10, 11:58 pm, Mark Wyszomierski mar...@gmail.com wrote: Hi, I have a few apps in the marketplace. One of them no longer appears in searches, and if I look under the other apps from this developer page for myself, it doesn't appear there either. I can see the app ok using its direct url, and it also appears ok in my marketplace control panel. There aren't any notes on it like that it was banned or something, it's a pretty generic application. Anyone else experiencing this? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] BackupAgent
Hi, I'm trying to implement BackupAgent functionality but I have no luck. It works well in emulator 2.2 but doesn't in emulator 2.3, 2.3.3 or in my device with 2.3.3. In 2.3.x it just displays when I run bmgr backup run in adb shell: 06-10 10:25:39.263: DEBUG/AndroidRuntime(14616): Calling main entry com.android.commands.bmgr.Bmgr 06-10 10:25:39.273: DEBUG/AndroidRuntime(14616): Shutting down VM In 2.2 emulator everything is ok! Do you have any idea? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: BackupAgent
If I wipe user data when I start emulator then backup works. There is a setting or something that can disable backup process? What should I do to work it on my phone too? On Jun 10, 10:35 am, b_t bartata...@gmail.com wrote: Hi, I'm trying to implement BackupAgent functionality but I have no luck. It works well in emulator 2.2 but doesn't in emulator 2.3, 2.3.3 or in my device with 2.3.3. In 2.3.x it just displays when I run bmgr backup run in adb shell: 06-10 10:25:39.263: DEBUG/AndroidRuntime(14616): Calling main entry com.android.commands.bmgr.Bmgr 06-10 10:25:39.273: DEBUG/AndroidRuntime(14616): Shutting down VM In 2.2 emulator everything is ok! Do you have any idea? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: BackupAgent
Thank you for your response. All of these options are enabled in my phone but backup still doesn't work. Maybe the problem is about my ROM, I don't know On Jun 10, 1:14 pm, Kostya Vasilyev kmans...@gmail.com wrote: Ok, here is some info: http://developer.android.com/guide/topics/data/backup.html#Testing Ensure that backup is enabled - If using the emulator, you can enable backup with the following command from your SDKtools/ path: adb shell bmgr enable true - If using a device, open the system *Settings*, select *Privacy*, then enable *Back up my data* and *Automatic restore*. - ( strangely enough, my Xperia Arc running 2.3.3 doesn't have this setting under Privacy but a Galaxy S does ) -- Kostya 2011/6/10 Kostya Vasilyev kmans...@gmail.com I remember there being some kind of user setting when configuring a new phone. Can't say exactly what it is, might be the second from the top under Accounts and Sync in Settings. -- Kostya Vasilyev 10.06.2011 13:01 пользователь b_t bartata...@gmail.com написал: If I wipe user data when I start emulator then backup works. There is a setting or something that can disable backup process? What should I do to work it on my phone too? On Jun 10, 10:35 am, b_t bartata...@gmail.com wrote: Hi, I'm trying to implement BackupAgent functionality but I have no luck. It works well in emulator 2.2 but doesn't in emulator 2.3, 2.3.3 or in my device with 2.3.3. In 2.3.x it just displays when I run bmgr backup run in adb shell: 06-10 10:25:39.263: DEBUG/AndroidRuntime(14616): Calling main entry com.android.commands.bmgr.Bmgr 06-10 10:25:39.273: DEBUG/AndroidRuntime(14616): Shutting down VM In 2.2 emulator everything is ok! Do you have any idea? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Invalid column contact_id
Hi, I try to pick a contact number by: Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE); And I try to get a contact from the result by: Uri contactData = intent.getData(); ContentResolver cr = getContext().getContentResolver(); Cursor c = cr.query(uri, new String[] { Data.CONTACT_ID, Data.LOOKUP_KEY, Phone.NUMBER }, null, null, null); And in some devices or for some contacts it throws: java.lang.IllegalArgumentException: Invalid column contact_id The URI is for example: content://com.android.contacts/contacts/lookup/812i70704be008e61b18/694 Is it possible that CONTACT_ID column doesn't exist? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Invalid column contact_id
It returns only one row for a selected phone number. The URI contains the condition after the lookup key. This URI is returned by the phone number selection activity. On May 23, 9:39 am, Zsolt Vasvari zvasv...@gmail.com wrote: I take that back. I actually don't know if that query will work or not. I always just use ContactsContract.Contacts.CONTENT_URI and give it a WHERE clause and a key and it works with the CONTACT_ID column. On May 23, 3:23 pm, Zsolt Vasvari zvasv...@gmail.com wrote: Your query will return the entire contacts database since you don't have a WHERE clause and a key. On May 23, 3:03 pm, b_t bartata...@gmail.com wrote: Hi, I try to pick a contact number by: Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE); And I try to get a contact from the result by: Uri contactData = intent.getData(); ContentResolver cr = getContext().getContentResolver(); Cursor c = cr.query(uri, new String[] { Data.CONTACT_ID, Data.LOOKUP_KEY, Phone.NUMBER }, null, null, null); And in some devices or for some contacts it throws: java.lang.IllegalArgumentException: Invalid column contact_id The URI is for example: content://com.android.contacts/contacts/lookup/812i70704be008e61b18/694 Is it possible that CONTACT_ID column doesn't exist? Thanks, Tamás- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: GSM signal strength unknown returned in Gingerbread 2.3.3
Some of my users with 2.3.3 get always unknown signal strength too. So I'm interested in the answer too. On May 16, 2:12 am, Alex maroeb...@gmail.com wrote: I have registered a PhoneStateListener and I am listening to onSignalStrengthChanged(asu) and onSignalStrengthsChanged(SignalStrength signalStrength). On Eclair, these events correctly return the GSMsignalstrengthin asu, but on Gingerbread onSignalStrengthChanged always returns -1 and signalStrength.GetGsmSignalStrength() always returns -99 (UNKNOWN_RSSI). This means it is impossible to read thesignalstrengthon Gingerbread. I tried my app on a phone with Gingerbread version 2.3.4 and it worked fine. Is this a known issue with2.3.3? Is there a workaround? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] How to check telephony is available
Hi, Is there any way to check if telephony is available? Checking for PackageManager.FEATURE_TELEPHONY feature is not a solution because there are phones that says false to this feature but has telephony. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 check telephony is available
I am not sure the PackageManager.FEATURE_TELEPHONY will return false as you described. I'm sure. Users wrote me and I asked them to check it. This feature is missing in their devices. One of the users has HTC EVO 4G, the other has HTC Sprint Hero devices. But if what you described is correct, why dont you check the IMSI or the phone number? Maybe it is the solution, I don't know. That is why I wrote my post. In a Xoom for example, if I try to get TelephonyManager then I got null or exception or I got the instance? You know I put the FEATURE_TELEPHONY check to my app to work well on tablets too. I want telephony-specific features disabled on that devices. After this update I got the emails that these options are disabled in their phones. Maybe it is good to know for everybody that it isn't the reliable solution. T. Terence On Apr 26, 4:30 pm, b_t bartata...@gmail.com wrote: Hi, Is there any way to check if telephony is available? Checking for PackageManager.FEATURE_TELEPHONY feature is not a solution because there are phones that says false to this feature but has telephony. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 check telephony is available
The HTC EVO 4G has factory rom. On Apr 26, 12:07 pm, b_t bartata...@gmail.com wrote: I am not sure the PackageManager.FEATURE_TELEPHONY will return false as you described. I'm sure. Users wrote me and I asked them to check it. This feature is missing in their devices. One of the users has HTC EVO 4G, the other has HTC Sprint Hero devices. But if what you described is correct, why dont you check the IMSI or the phone number? Maybe it is the solution, I don't know. That is why I wrote my post. In a Xoom for example, if I try to get TelephonyManager then I got null or exception or I got the instance? You know I put the FEATURE_TELEPHONY check to my app to work well on tablets too. I want telephony-specific features disabled on that devices. After this update I got the emails that these options are disabled in their phones. Maybe it is good to know for everybody that it isn't the reliable solution. T. Terence On Apr 26, 4:30 pm, b_t bartata...@gmail.com wrote: Hi, Is there any way to check if telephony is available? Checking for PackageManager.FEATURE_TELEPHONY feature is not a solution because there are phones that says false to this feature but has telephony. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Appwidget + AsyncTask + Handler
It works well if it is the main thread. In all my version I uses this way. There isn't long-running work when I update my widget but sometime (very very rarely) I got ANR. For example when I try to get application label from PackageManager. I thought that I can avoid these ANRs with AsyncTask but it seems it cause other problems. Thank you for your answer, I won't use AsyncTask then. On Apr 20, 6:20 pm, Dianne Hackborn hack...@android.com wrote: Do your work on the main thread, at least the stuff retrieving the bluetooth adapter. Is there a reason you are using AsyncTask for this anyway? Is there some long-running work you are also doing? 2011/4/20 b_t bartata...@gmail.com I don't know what firmware it is but when I updated my app today I got tons of error mails from different types of devices so it must be a popular one. On Apr 20, 4:17 pm, Kostya Vasilyev kmans...@gmail.com wrote: Have you looked at Android's own Power Controls widget? It's part of Settings application. Also, is it possible you're dealing with some heavily modified, buggy firmware? 20.04.2011 18:00 пользователь b_t bartata...@gmail.com написал: The original stack trace is: Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.init(Handler.java:121) at android.bluetooth.BluetoothAdapter $1.init(BluetoothAdapter.java:961) at android.bluetooth.BluetoothAdapter.init(BluetoothAdapter.java:961) at android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java: 308) *** myTask.doInBackground() *** at android.os.AsyncTask$2.call(AsyncTask.java:185) at java.util.concurrent.FutureTask $Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1068) at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:561) at java.lang.Thread.run(Thread.java:1102) I try to explain what I want: - I have an appwidget with a bluetooth toggle - If the bluetooth state changes the appwidget will be updated - If I click on the appwidget than I toggle bluetooth state If I click on the toggle: - an IntentService will be executed - it creates a Handler and displays a toast by Handler.post() with the message turning off... - I change bluetooth state - bluetooth state changes so my broadcast receiver tries to update appwidget If I update appwidget in a service than everything is ok except that APN can occur if the update process is slow for some reason. I would like to put appwidget update mechanism into an AsyncTask. But because of BluetoothAdapter.getDefaultAdapter creates a Handler (in some roms) it throws the exception above. If I put Looper.prepare() in the begin of doInBackground, then the following error occurs for a thread (there are five asynctask thread in my device so it happens very early) java.lang.RuntimeException: Only one Looper may be created per thread If I use the following code: Looper myLooper = Looper.myLooper(); if (myLooper == null) { Looper.prepare(); } than everything seems fine except one thing: to toast I would like to display in the beginning of the process will be displayed much time later. I don't know why and how can I avoid it. I hope somebody understand my problem and can give me a solution. T. On Apr 20, 10:17 am, Kostya Vasilyev kmans...@gmail.com wrote: You could try calling Looper.prepare() first thing in doInBackground(). Oh, and logcat output would help us help you, as usual. -- Kostya 20.04.2011 12:07, b_t пишет: Hi, In my app I was going to use an AsyncTask to update appwidget data because this process can be long. To get the state I have to call BluetoothAdapter.getDefaultAdapter(). The problem is that in some device (not in mine) it tries to initialize a Handler and throws Exception about missing Looper. I don't know what should I do. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr
[android-developers] Appwidget + AsyncTask + Handler
Hi, In my app I was going to use an AsyncTask to update appwidget data because this process can be long. To get the state I have to call BluetoothAdapter.getDefaultAdapter(). The problem is that in some device (not in mine) it tries to initialize a Handler and throws Exception about missing Looper. I don't know what should I do. T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Appwidget + AsyncTask + Handler
The original stack trace is: Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.init(Handler.java:121) at android.bluetooth.BluetoothAdapter $1.init(BluetoothAdapter.java:961) at android.bluetooth.BluetoothAdapter.init(BluetoothAdapter.java:961) at android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java: 308) *** myTask.doInBackground() *** at android.os.AsyncTask$2.call(AsyncTask.java:185) at java.util.concurrent.FutureTask $Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1068) at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:561) at java.lang.Thread.run(Thread.java:1102) I try to explain what I want: - I have an appwidget with a bluetooth toggle - If the bluetooth state changes the appwidget will be updated - If I click on the appwidget than I toggle bluetooth state If I click on the toggle: - an IntentService will be executed - it creates a Handler and displays a toast by Handler.post() with the message turning off... - I change bluetooth state - bluetooth state changes so my broadcast receiver tries to update appwidget If I update appwidget in a service than everything is ok except that APN can occur if the update process is slow for some reason. I would like to put appwidget update mechanism into an AsyncTask. But because of BluetoothAdapter.getDefaultAdapter creates a Handler (in some roms) it throws the exception above. If I put Looper.prepare() in the begin of doInBackground, then the following error occurs for a thread (there are five asynctask thread in my device so it happens very early) java.lang.RuntimeException: Only one Looper may be created per thread If I use the following code: Looper myLooper = Looper.myLooper(); if (myLooper == null) { Looper.prepare(); } than everything seems fine except one thing: to toast I would like to display in the beginning of the process will be displayed much time later. I don't know why and how can I avoid it. I hope somebody understand my problem and can give me a solution. T. On Apr 20, 10:17 am, Kostya Vasilyev kmans...@gmail.com wrote: You could try calling Looper.prepare() first thing in doInBackground(). Oh, and logcat output would help us help you, as usual. -- Kostya 20.04.2011 12:07, b_t пишет: Hi, In my app I was going to use an AsyncTask to update appwidget data because this process can be long. To get the state I have to call BluetoothAdapter.getDefaultAdapter(). The problem is that in some device (not in mine) it tries to initialize a Handler and throws Exception about missing Looper. I don't know what should I do. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Appwidget + AsyncTask + Handler
I don't know what firmware it is but when I updated my app today I got tons of error mails from different types of devices so it must be a popular one. On Apr 20, 4:17 pm, Kostya Vasilyev kmans...@gmail.com wrote: Have you looked at Android's own Power Controls widget? It's part of Settings application. Also, is it possible you're dealing with some heavily modified, buggy firmware? 20.04.2011 18:00 пользователь b_t bartata...@gmail.com написал: The original stack trace is: Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.init(Handler.java:121) at android.bluetooth.BluetoothAdapter $1.init(BluetoothAdapter.java:961) at android.bluetooth.BluetoothAdapter.init(BluetoothAdapter.java:961) at android.bluetooth.BluetoothAdapter.getDefaultAdapter(BluetoothAdapter.java: 308) *** myTask.doInBackground() *** at android.os.AsyncTask$2.call(AsyncTask.java:185) at java.util.concurrent.FutureTask $Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1068) at java.util.concurrent.ThreadPoolExecutor $Worker.run(ThreadPoolExecutor.java:561) at java.lang.Thread.run(Thread.java:1102) I try to explain what I want: - I have an appwidget with a bluetooth toggle - If the bluetooth state changes the appwidget will be updated - If I click on the appwidget than I toggle bluetooth state If I click on the toggle: - an IntentService will be executed - it creates a Handler and displays a toast by Handler.post() with the message turning off... - I change bluetooth state - bluetooth state changes so my broadcast receiver tries to update appwidget If I update appwidget in a service than everything is ok except that APN can occur if the update process is slow for some reason. I would like to put appwidget update mechanism into an AsyncTask. But because of BluetoothAdapter.getDefaultAdapter creates a Handler (in some roms) it throws the exception above. If I put Looper.prepare() in the begin of doInBackground, then the following error occurs for a thread (there are five asynctask thread in my device so it happens very early) java.lang.RuntimeException: Only one Looper may be created per thread If I use the following code: Looper myLooper = Looper.myLooper(); if (myLooper == null) { Looper.prepare(); } than everything seems fine except one thing: to toast I would like to display in the beginning of the process will be displayed much time later. I don't know why and how can I avoid it. I hope somebody understand my problem and can give me a solution. T. On Apr 20, 10:17 am, Kostya Vasilyev kmans...@gmail.com wrote: You could try calling Looper.prepare() first thing in doInBackground(). Oh, and logcat output would help us help you, as usual. -- Kostya 20.04.2011 12:07, b_t пишет: Hi, In my app I was going to use an AsyncTask to update appwidget data because this process can be long. To get the state I have to call BluetoothAdapter.getDefaultAdapter(). The problem is that in some device (not in mine) it tries to initialize a Handler and throws Exception about missing Looper. I don't know what should I do. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ImageView
Hi, I can't find it out how to use ImageView to get what I want: - fill parent vertically - maintain the original aspect ratio So the imageview should change its width. Thank you, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: ImageView
It seems this is my own thread ;) I managed to solve my problem by creating a custom view from ImageView. It would be fine if it could be done by using directly the ImageView class. On Apr 13, 1:44 pm, b_t bartata...@gmail.com wrote: Hi, I can't find it out how to use ImageView to get what I want: - fill parent vertically - maintain the original aspect ratio So the imageview should change its width. Thank you, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ImageView
Hi, I have to do things with an ImageView after it has got a size. For example set an animation which depends on the size of the ImageView. What is the official way to do size-dependent things? I tried to create a new class from ImageView and overwrite onMeasure. It worked on my phone but didn't on the emulator? Is there a good way to do it without creating a new class? Thanks, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Problem loading gadget
Hi, Some of my users always complaining about that my appwidgets gone when they update my application. The problem loading gadget text are displayed instead of my widgets. If I know well, than this message is displayed when the OS can't found the application for the widget. What can cause this update problem? I always upload my app signed with the same key. T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Problem loading gadget
No, I didn't change anything in widget xmls. On Apr 7, 10:41 pm, String sterling.ud...@googlemail.com wrote: If users get that message just when updating your app, one possible cause is that you've made a change in your widget's XML. Changing something like the name of the XML file means that the OS doesn't recognize it as the same widget - so it can't find the widget to load - so it displays that message. For this reason, I've got widgets with some really obsolete names to their XML, but I'm not willing to change them. If you already have, then the best you can probably do is to advice your users that they need to just delete and re-add the widget. String -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Shortcut
Hi, In my app there is a possibility to add a shortcut to my widget. It works well for almost every shortcut type. But doesn't work well for shortcuts of a specific application. When I add this shortcut to my home screen by the launcher and click on it the following intent will be executed: 04-05 20:59:39.384: INFO/ActivityManager(184): Starting: Intent { act=android.intent.action.VIEW flg=0x1000 cmp=vStudio.Android.GPhotoPaid/.GPhotoMain bnds=[125,553][235,671] (has extras) } from pid 12552 It works as expected. But when I create this shortcut from my app and I click on its icon, then 04-05 20:59:05.844: INFO/ActivityManager(184): Starting: Intent { flg=0x1000 cmp=vStudio.Android.GPhotoPaid/.GPhotoMain bnds=[133,408][201,456] (has extras) } from pid -1 The difference is the VIEW action. When I add the VIEW action manually to this intent, then this shortcut works well too, but I cannot do that of course because it makes other type of shortcuts wrong. I have looked throught the Launcher source code how it handles shortcut intents but it doesn't do anything with it, just adds a FLAG_ACTIVITY_NEW_TASK to it. Can anybody help me what cause this difference? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Shortcut
Maybe it depends on the Launcher. I just tried Launcher Pro, and it creates the same wrong shortcut intent as created from my app. I wish I knew what Launcher is the default launcher in my device ... On ápr. 5, 21:38, b_t bartata...@gmail.com wrote: Hi, In my app there is a possibility to add a shortcut to my widget. It works well for almost every shortcut type. But doesn't work well for shortcuts of a specific application. When I add this shortcut to my home screen by the launcher and click on it the following intent will be executed: 04-05 20:59:39.384: INFO/ActivityManager(184): Starting: Intent { act=android.intent.action.VIEW flg=0x1000 cmp=vStudio.Android.GPhotoPaid/.GPhotoMain bnds=[125,553][235,671] (has extras) } from pid 12552 It works as expected. But when I create this shortcut from my app and I click on its icon, then 04-05 20:59:05.844: INFO/ActivityManager(184): Starting: Intent { flg=0x1000 cmp=vStudio.Android.GPhotoPaid/.GPhotoMain bnds=[133,408][201,456] (has extras) } from pid -1 The difference is the VIEW action. When I add the VIEW action manually to this intent, then this shortcut works well too, but I cannot do that of course because it makes other type of shortcuts wrong. I have looked throught the Launcher source code how it handles shortcut intents but it doesn't do anything with it, just adds a FLAG_ACTIVITY_NEW_TASK to it. Can anybody help me what cause this difference? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Activity lifecycle
Hi, Maybe an easy question. When activity A launches activity B then it is possible that A destroyes before the user navigates back from B? So A will be recreated and don't remain object state? T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Activity lifecycle
And is there any way to force stop activity A to test if my onRestoreInstanceState and onSavedInstanceState implementation works when returning from B? In my device A is never destroyed. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ShortcutIconResource
Hi, When I pick a shortcut I can get a ShortcutIconResource from the intent (Intent.EXTRA_SHORTCUT_ICON_RESOURCE). I would like to display this icon. How can I get a Bitmap or Drawable from it? Thanks, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: BadParcelableException
Kostya: thank you, your suggestions solved my problem But I think when I call data.getSerializableExtra(SETTINGS) and I'm sure that there is no SETTINGS extra in data intent I shouldn't get ClassNotFoundException. Maybe the problem is that it tries to read everything, not only the SETTINGS parameter and there is an object in the intent for which I don't have the class. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] BadParcelableException
Hi, My activity starts other activities to get a result from them: - starts an activity of mine which returns a Serializable object with the intent or - starts an activity with ACTION_PICK to pick a contact In my onActivityResult method I check if it is the first case or not by calling Settings settings = (Settings)data.getSerializableExtra(SETTINGS); I got the following exceptions: Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.motorola.blur.provider.contacts.IdentityModel at android.os.Parcel.readParcelable(Parcel.java:1883) at android.os.Parcel.readParcelableArray(Parcel.java:1922) at android.os.Parcel.readValue(Parcel.java:1825) at android.os.Parcel.readMapInternal(Parcel.java:2008) at android.os.Bundle.unparcel(Bundle.java:208) at android.os.Bundle.getSerializable(Bundle.java:1189) at android.content.Intent.getSerializableExtra(Intent.java: 3469) ... I don't understand it. What is this IdentityModel class? If my activity returns than the serializable object is a Settings. If an other activity returns than SETTINGS extra should be null. Why I get ClassNotFoundException? T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] CamcorderProfile
Hi, My camcorder resolution is set to 1280x720 in my Htc Desire with 2.2. If I get CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH) then it says that resolution is 720*480. QUALITY_HIGH refers to the highest quality available Do you know why? How can I get maximum camcorder resolution? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: CamcorderProfile
Oh, I understand, thank you On Mar 22, 9:26 am, Marcin Orlowski webnet.andr...@gmail.com wrote: On 22 March 2011 09:17, b_t bartata...@gmail.com wrote: Hi, My camcorder resolution is set to 1280x720 in my Htc Desire with 2.2. If I get CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH) then it says that resolution is 720*480. QUALITY_HIGH refers to the highest quality available Do you know why? How can I get maximum camcorder resolution? Quality is not synonim for resolution. Isn't the framerate higher on Desire in 720x480 than in 1280x720? If so, then framerate is aparently higher quality factor, and weights more than frame resolution Regards, Marcin Orlowski Tray Agenda http://bit.ly/trayagenda - keep you daily schedule handy... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] appwidgets
Hi, some of my users complains that my appwidgets aren't found in the widget list so they can't add them to the dashboard. Does anyone know how it is possible? I reinstall my app many times from apk - not from the market - during development and sometimes I got the same problem and I have to reboot my device. And after rebooting the widgets are there in the list. Thanks, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Bitmap recycle
Hi, when I use imageView.setImageResource(int) or imageView.setImageDrawable(packageManager.getApplicationIcon(packageName)) or imageView.setImageDrawable(resolveInfo.loadIcon(packageManager)) should I recycle bitmap inside the imageView when I change the image? Or not because the returned bitmaps are cached inside and can be used again? How can I decide if I have to recycle bitmaps or not? I don't have memory problems on my Desire but I can see that some Nexus One users have. T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Check permissions
Ping. Can somebody help? On Mar 4, 9:29 am, b_t bartata...@gmail.com wrote: Hi, thank you for this suggestion A put the following line in the manifest of my content provider addon (MYPERMISSION is replaced by the correct value): permission android:name=MYPERMISSION android:protectionLevel=signature/ And I didn't put uses-permission tag for this permission in the main app of mine but it could use the provider. Is it ok or not? Need I to declare this permission as required? On Feb 27, 6:19 pm, Dianne Hackborn hack...@android.com wrote: There is *no* need to use a shared used ID. Signature-based permissions do this, in a much more clean way. Also as pointed out, you can't change your app to a shared used ID if it doesn't already use one. And I really discourage people from using shared user IDs; there are lots of subtle implications of doing that, which I would prefer just be avoided. On Sat, Feb 26, 2011 at 11:51 PM, b_t bartata...@gmail.com wrote: Can Shared ID be used for this purpose with setting content provider as not exported? Then only my app could use this addon, am I right? If my app (which contains appwidgets) didn't have a shared id before and I set this in the next update will it work without any problem? Appwidgets uses this id or not? They are running in the name of this user? On febr. 26, 22:12, Dianne Hackborn hack...@android.com wrote: Yes a help application works well. Just be sure that if you do such a thing it is in a secure way -- for example if this is structured as a Service that your main application binds to in order to have it do stuff with SMS messages, declare a signature permission in the help that restricts access to it, and use it in your main app. This way other applications can't get the permission and can't find to your service and abuse you as a security hole (in which case your helper app will get the blame, since it is the one accessing the SMS data). On Sat, Feb 26, 2011 at 12:32 PM, Kostya Vasilyev kmans...@gmail.com wrote: I do have a suggestion for you - you could implement additional functionality as an add-on, a companion application. Android has features that make it pretty easy to implement (shared user ids, intents, services, being able to query installed packages and intent resolution). Some applications that are available in Market already do this (e.g. Smart Keyboard, ES File Explorer, those are just the ones I use, there are certainly many more). 26.02.2011 22:18, b_t пишет: There are users who don't read the app description nor the comments. They don't write an email to ask just write a bad comment. Yes, users are a pain - they are ignorant, paranoid, moronic, inarticulate. The world would a better place without them :) /irony So explaining it doesn't help because they don't read. I always try to answer comments but the next comments keep asking the same questions. True. But I also find that sometimes there are things you can do to address certain often asked questions or misunderstood functionality - like adding a help button, or tweaking how the information is presented, so it's more obvious. So I'm not satisfied with this permission model, what about you? Well, my two current application are so simple, it's not even funny. The permissions they request are obvious, so my experience doesn't really apply here. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 -- 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
[android-developers] Re: Check permissions
Hi, thank you for this suggestion A put the following line in the manifest of my content provider addon (MYPERMISSION is replaced by the correct value): permission android:name=MYPERMISSION android:protectionLevel=signature/ And I didn't put uses-permission tag for this permission in the main app of mine but it could use the provider. Is it ok or not? Need I to declare this permission as required? On Feb 27, 6:19 pm, Dianne Hackborn hack...@android.com wrote: There is *no* need to use a shared used ID. Signature-based permissions do this, in a much more clean way. Also as pointed out, you can't change your app to a shared used ID if it doesn't already use one. And I really discourage people from using shared user IDs; there are lots of subtle implications of doing that, which I would prefer just be avoided. On Sat, Feb 26, 2011 at 11:51 PM, b_t bartata...@gmail.com wrote: Can Shared ID be used for this purpose with setting content provider as not exported? Then only my app could use this addon, am I right? If my app (which contains appwidgets) didn't have a shared id before and I set this in the next update will it work without any problem? Appwidgets uses this id or not? They are running in the name of this user? On febr. 26, 22:12, Dianne Hackborn hack...@android.com wrote: Yes a help application works well. Just be sure that if you do such a thing it is in a secure way -- for example if this is structured as a Service that your main application binds to in order to have it do stuff with SMS messages, declare a signature permission in the help that restricts access to it, and use it in your main app. This way other applications can't get the permission and can't find to your service and abuse you as a security hole (in which case your helper app will get the blame, since it is the one accessing the SMS data). On Sat, Feb 26, 2011 at 12:32 PM, Kostya Vasilyev kmans...@gmail.com wrote: I do have a suggestion for you - you could implement additional functionality as an add-on, a companion application. Android has features that make it pretty easy to implement (shared user ids, intents, services, being able to query installed packages and intent resolution). Some applications that are available in Market already do this (e.g. Smart Keyboard, ES File Explorer, those are just the ones I use, there are certainly many more). 26.02.2011 22:18, b_t пишет: There are users who don't read the app description nor the comments. They don't write an email to ask just write a bad comment. Yes, users are a pain - they are ignorant, paranoid, moronic, inarticulate. The world would a better place without them :) /irony So explaining it doesn't help because they don't read. I always try to answer comments but the next comments keep asking the same questions. True. But I also find that sometimes there are things you can do to address certain often asked questions or misunderstood functionality - like adding a help button, or tweaking how the information is presented, so it's more obvious. So I'm not satisfied with this permission model, what about you? Well, my two current application are so simple, it's not even funny. The permissions they request are obvious, so my experience doesn't really apply here. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 -- 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
[android-developers] sms compose activity
Hi, I can start SMS compose activity by Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sms:#)); startActivity(intent); Is it possible to set the phone number or contact id? (the To field of the activity) Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Phantom appwidgets
Hi, There are two ways to create phantom widgets: - try to add a new widget, configuration screen appears, canceling widget creation - try to add a new widget, configuration screen appears, save the widget, there is no place in home screen, canceling After these steps a new appwidget was created and exists in the background, but it isn't visible anywhere. In the first case appwidget isn't configured, but in the second it is. When I get widgets for my provider this appwidget is returned. Nor the app and the user can remove this appwidget. What cause this bug? The OS itself? What can I do to get rid of these widgets without uninstalling my app? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Phantom appwidgets
Hi, yes I've already use this trick and it is good for the first case, when the widget hasn't been configured yet because of canceling it. But it doesn't work for the second case. In this case the widget is configured but can't be placed in the screen because of there were no place for it. There is no difference between this phantom appwidget and a normal appwidget. Tamás On márc. 4, 19:20, Kostya Vasilyev kmans...@gmail.com wrote: This is a bug in Launcher2. Actually, a few of them, appearing in various cases. Some of them got fixed (I forget which and when - you can checkhttp://b.android.com), some others still aren't, it seems. In any case, them being fixed now doesn't help when running on an older version of Android. The only solution I found is to track validity state for each widget id. It's easy to do if you already have a config activity. http://kmansoft.wordpress.com/2010/06/22/per-widget-options-stale-wid... -- Kostya 04.03.2011 21:14, b_t пишет: Hi, There are two ways to create phantom widgets: - try to add a new widget, configuration screen appears, canceling widget creation - try to add a new widget, configuration screen appears, save the widget, there is no place in home screen, canceling After these steps a new appwidget was created and exists in the background, but it isn't visible anywhere. In the first case appwidget isn't configured, but in the second it is. When I get widgets for my provider this appwidget is returned. Nor the app and the user can remove this appwidget. What cause this bug? The OS itself? What can I do to get rid of these widgets without uninstalling my app? Thanks, Tamás -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Phantom appwidgets
I can reproduce it anytime in my HTC Desire 2.2. After you configured your widget and have to place it somewhere where there is no place, just press Back. If I press Remove the widget is removed. But with Back it isn't. On Mar 4, 9:50 pm, Kostya Vasilyev kmans...@gmail.com wrote: 04.03.2011 23:34, b_t пишет: yes I've already use this trick and it is good for the first case, when the widget hasn't been configured yet because of canceling it. But it doesn't work for the second case. In this case the widget is configured but can't be placed in the screen because of there were no place for it. Just tested the second case - if I cancel widget creation (after it's moved to a different virtual screen to insufficient screen space on the current one), the widget id is removed. This is a Samsung Galaxy S running 2.2. There is no difference between this phantom appwidget and a normal appwidget. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Phantom appwidgets
I checked the issues you sent me and I only found 9362. This is in New state since June, 2010 On Mar 4, 9:50 pm, Kostya Vasilyev kmans...@gmail.com wrote: 04.03.2011 23:34, b_t пишет: yes I've already use this trick and it is good for the first case, when the widget hasn't been configured yet because of canceling it. But it doesn't work for the second case. In this case the widget is configured but can't be placed in the screen because of there were no place for it. Just tested the second case - if I cancel widget creation (after it's moved to a different virtual screen to insufficient screen space on the current one), the widget id is removed. This is a Samsung Galaxy S running 2.2. There is no difference between this phantom appwidget and a normal appwidget. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Check permissions
I know how permissions work. I'm thinking about creating two apk-s with different manifest, different required permissions. I don't want the source code to be changed. That is why I would like to check permission realtime. Kevin, so can I use that method in this way? packageManager.checkPermission(android.permission.READ_SMS, myPackage) == PERMISSION_GRANTED; I didn't know that I should use this method or the SecurityManager. Zsolt, I wish we could declare a permission as optional. This is a very hard decision to add new permission requirement to the app. Maybe it can improve the funcionality of the app, but there will be users who complain about the new permission, uninstall the app or give you 1 star. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Check permissions
I don't know what would be a good solution for this problem. The problem is that half of the users would like the new features that required personal permissions (read sms, get accounts, ...) and the other half of the users would uninstall or not to update the app because they afraid for their personal data. Maybe it is a bad solution to create two versions with different permissions. Do you know how to solute this problem? I'm thinking of an other solution. I create a new addon apk with these permissions. This is a content provider which provides the required data. The user can make a decision if he installs this app or not. The main app checks if there is a provider and could get this information from it. What do you think about it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Check permissions
There are users who don't read the app description nor the comments. They don't write an email to ask just write a bad comment. So explaining it doesn't help because they don't read. I always try to answer comments but the next comments keep asking the same questions. So I'm not satisfied with this permission model, what about 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: Check permissions
Can Shared ID be used for this purpose with setting content provider as not exported? Then only my app could use this addon, am I right? If my app (which contains appwidgets) didn't have a shared id before and I set this in the next update will it work without any problem? Appwidgets uses this id or not? They are running in the name of this user? On febr. 26, 22:12, Dianne Hackborn hack...@android.com wrote: Yes a help application works well. Just be sure that if you do such a thing it is in a secure way -- for example if this is structured as a Service that your main application binds to in order to have it do stuff with SMS messages, declare a signature permission in the help that restricts access to it, and use it in your main app. This way other applications can't get the permission and can't find to your service and abuse you as a security hole (in which case your helper app will get the blame, since it is the one accessing the SMS data). On Sat, Feb 26, 2011 at 12:32 PM, Kostya Vasilyev kmans...@gmail.comwrote: I do have a suggestion for you - you could implement additional functionality as an add-on, a companion application. Android has features that make it pretty easy to implement (shared user ids, intents, services, being able to query installed packages and intent resolution). Some applications that are available in Market already do this (e.g. Smart Keyboard, ES File Explorer, those are just the ones I use, there are certainly many more). 26.02.2011 22:18, b_t пишет: There are users who don't read the app description nor the comments. They don't write an email to ask just write a bad comment. Yes, users are a pain - they are ignorant, paranoid, moronic, inarticulate. The world would a better place without them :) /irony So explaining it doesn't help because they don't read. I always try to answer comments but the next comments keep asking the same questions. True. But I also find that sometimes there are things you can do to address certain often asked questions or misunderstood functionality - like adding a help button, or tweaking how the information is presented, so it's more obvious. So I'm not satisfied with this permission model, what about you? Well, my two current application are so simple, it's not even funny. The permissions they request are obvious, so my experience doesn't really apply here. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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] FileNotFoundException
Hi, I get the following exceptions (from my users) when I try to open a fileoutputstream: phone model: GT-I5800, android version: 2.1-update1, exception: java.io.FileNotFoundException: /sdcard/MYPATH/FILENAME at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java: 244) at java.io.FileOutputStream.init(FileOutputStream.java:97) at java.io.FileOutputStream.init(FileOutputStream.java:69) phone model: PC36100, android version: 2.2, exception: java.io.FileNotFoundException: /mnt/sdcard/MYPATH/FILENAME (Invalid argument) at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method) at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java: 152) at java.io.FileOutputStream.init(FileOutputStream.java:97) MYPATH and FILENAME are variables and they looks good. For example: widgets for MYPATH and 4x1_Standart for FILENAME My code is the following: String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { File folder = new File(Environment.getExternalStorageDirectory(), folderName); if (!folder.exists()) { folder.mkdirs(); } FileOutputStream fos = new FileOutputStream(file); // I get this exception here } What is wrong? Should I check something else? It works well on my phone, so I don't know why these errors occur. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: FileNotFoundException
widgets was just an example, the folder and file is: File folder = new File(Environment.getExternalStorageDirectory(), myAppName + /widgets); if (!folder.exists()) { folder.mkdirs(); } File file = new File(folder, fileName); On febr. 25, 18:47, TreKing treking...@gmail.com wrote: On Fri, Feb 25, 2011 at 11:17 AM, b_t bartata...@gmail.com wrote: What is wrong? Should I check something else? What is file? Check the result of mkdirs. Also, widgets is a terrible name for a folder to place at the root of the user's SD card. There are official ways of creating folders on the SD card for later versions of Android. At the very least, name it something that easily identifies it with your app. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Check permissions
Hi, What is the correct way to check if app has a permission, for example android.permission.READ_SMS. I would like to create different versions of my app with the same code but different manifest xml with different permissions. So I would like to check runtime if this version has a permission or not. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Check if action activity exists
Hi, ACTION_NETWORK_OPERATOR_SETTINGS says that In some cases, a matching Activity may not exist How can I check if there is an activity or not before I try to start the activity? I wanted to show a feature only if this activity exists. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Check if action activity exists
This is not good for me. I would like to show a list to the user to select an action what to do. So I can't start the activity before to check if it exists or not. And it is not elegant that after he clicks on it I say, oops I can't do that. And I would like to set this intent in an appwidget. On Feb 24, 9:49 am, Kostya Vasilyev kmans...@gmail.com wrote: You can just call startActivity without any prior checks, and catch ActivityNotFoundException. -- Kostya 24.02.2011 11:45, b_t пишет: Hi, ACTION_NETWORK_OPERATOR_SETTINGS says that In some cases, a matching Activity may not exist How can I check if there is an activity or not before I try to start the activity? I wanted to show a feature only if this activity exists. Thanks, Tamás -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Check if action activity exists
Thank you, this code works well: Intent intent = new Intent(ACTION_NETWORK_OPERATOR_SETTINGS); boolean available = intent.resolveActivity(context.getPackageManager()) != null; On Feb 24, 10:32 am, Kostya Vasilyev kmans...@gmail.com wrote: OK then, use PackageManager to check for a match beforehand. 24.02.2011 12:27 пользователь b_t bartata...@gmail.com написал: This is not good for me. I would like to show a list to the user to select an action what to do. So I can't start the activity before to check if it exists or not. And it is not elegant that after he clicks on it I say, oops I can't do that. And I would like to set this intent in an appwidget. On Feb 24, 9:49 am, Kostya Vasilyev kmans...@gmail.com wrote: You can just call startActivity without any prior checks, and catch ActivityNotFoundException. -- Kostya 24.02.2011 11:45, b_t пишет: Hi, ACTION_NETWORK_OPERATOR_SETTINGS says that In some cases, a matching Activity may not exist How can I check if there is an activity or not before I try to start the activity? I wanted to show a feature only if this activity exists. Thanks, Tamás -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Saving layout file is very slow with Eclipse / ADT
I have the same problem too, but only in Windows. In Linux it is fast enought, but in Windows it us extremly slow. When I change resources I have to wait long minutes to continue the work. Same computer, same eclipse/sdk version, same project. The difference is only in OS and waiting time. On Feb 20, 2:11 pm, Kostya Vasilyev kmans...@gmail.com wrote: Something is wrong with your build environment. Saving one file (after a sufficient delay) does kick off an automatic build - but as there shouldn't be a ongoing build at that time yet, you should not get the dialog you're describing. Now, if you save two layout / resource files quickly one after another, then yes, the second one will wait for the automatic build triggered by the first one to complete, and you will get the dialog. Try to disable automatic builds, clean the project, including deleting everything in your project's bin folder, then re-enable it back, see if that fixes things. -- Kostya 20.02.2011 2:08, Tom пишет: No it happen even with one single layout file. --Tom -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] appwidget icon set
Hi, There are a lot of icons in my appwidget. I would like a feature that a user can choose widget icon set in different styles. I don't want to store every icon set in the apk, only the default, because the apk would grow very large, and it is an appwidget so can't install on sd. Downloading to SD is a good idea? What if sd is unmounted? It wouldn't be good if the appwidget couldn't update itself. I think it is impossible to change the icons in apk at runtime. How can I implement this feature? Thank you, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: appwidget icon set
I would like to use them in RemoteViews.setImageViewResource or setImageViewUri calls. On febr. 17, 12:42, Marcin Orlowski webnet.andr...@gmail.com wrote: I don't want to store every icon set in the apk, only the default, Depending on for what you are using your icons, it may be still fine to store additional sets in separate APKs. You can then reach them from your main app (however, as said, some API calls require local resources) -- Regards, Marcin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] sd cards
Hi, Some device has 2 SD-card. Is there any way in the API to get all of 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] imageRes
Hi, ActivityInfo class contains an icon attribute which is a resource id. Can my appwidget use this resource id to display this icon? (ResourceViews.setImageViewResource) Or I have to load the icon and call setImageViewBitmap? The problem with this solution that it puts more data to the transaction. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: imageRes
No, I would like to display icons of other installed applications. I thought that it isn't possible because a resource id is unique only in a project not in the whole system, am I right? Just I don't understand what the ActivityInfo.icon or ResolveInfo.icon is good for if I can't use that value to display the app icon. On Feb 7, 9:49 am, Kostya Vasilyev kmans...@gmail.com wrote: If that's your own application, sure. If it's not, I don't see how the remote side of RemoteViews would know to load some resources from your application and the icon from another package. -- Kostya 07.02.2011 11:44, b_t пишет: Hi, ActivityInfo class contains an icon attribute which is a resource id. Can my appwidget use this resource id to display this icon? (ResourceViews.setImageViewResource) Or I have to load the icon and call setImageViewBitmap? The problem with this solution that it puts more data to the transaction. Thanks, Tamás -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: imageRes
I haven't tried it because I didn't know how to build the Uri to be valid. Have you tried using a resource Uri? http://developer.android.com/reference/android/content/ContentResolve... Something like this: android.resource://the.other.apps.package.name/drawable/id_value -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: imageRes
Yes, I use this method now but android has a limitation somewhere inside and in a few device I get E/JavaBinder( 2254): !!! FAILED BINDER TRANSACTION !!! errors because of these drawables. So I'm trying to find out how to avoid this bug. Maybe Uri can help. Oh, and there is also this: http://developer.android.com/reference/android/content/pm/PackageItem...) but then you'd need to push the icon into the widget as a drawable, which is not very efficient across process boundaries, but it just depends on how often you'll be updating your widget. -- Kostya 07.02.2011 14:32, b_t пишет: No, I would like to display icons of other installed applications. I thought that it isn't possible because a resource id is unique only in a project not in the whole system, am I right? Just I don't understand what the ActivityInfo.icon or ResolveInfo.icon is good for if I can't use that value to display the app icon. On Feb 7, 9:49 am, Kostya Vasilyevkmans...@gmail.com wrote: If that's your own application, sure. If it's not, I don't see how the remote side of RemoteViews would know to load some resources from your application and the icon from another package. -- Kostya 07.02.2011 11:44, b_t пишет: Hi, ActivityInfo class contains an icon attribute which is a resource id. Can my appwidget use this resource id to display this icon? (ResourceViews.setImageViewResource) Or I have to load the icon and call setImageViewBitmap? The problem with this solution that it puts more data to the transaction. Thanks, Tamás -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ACTION_AIRPLANE_MODE_CHANGED
Hi, I have a question about airplane mode broadcast intent. The documentation says that the state extra value is a boolean. http://developer.android.com/reference/android/content/Intent.html#ACTION_AIRPLANE_MODE_CHANGED In the source of android apps, the PhoneApp reads it as integer: if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) { boolean enabled = System.getInt(getContentResolver(), System.AIRPLANE_MODE_ON, 0) == 0; ... } In some device (custom rom) there is an error if they try to read a boolean: 02-01 16:46:57.088: WARN/Bundle(302): java.lang.ClassCastException: java.lang.Integer 02-01 16:46:57.088: WARN/Bundle(302): at android.os.Bundle.getBoolean(Bundle.java:786) 02-01 16:46:57.088: WARN/Bundle(302): at android.content.Intent.getBooleanExtra(Intent.java:3259) 02-01 16:46:57.088: WARN/Bundle(302): at com.android.phone.PhoneApp $PhoneAppBroadcastReceiver.onReceive(PhoneApp.java:1677) Can you help me to understand it? It should be an integer or a boolean? Where is the mistake? Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Detect Android version
Hi, I thought that I can use Build.VERSION.SDK_INT for detect android version. But I got errors from my users because they has Froyo, Build.VERSION.RELEASE returns 2.2 (I can see it in error mails), and Build.VERSION.SDK_INT has value 9. It says that it is gingerbread and my app tries to use gingerbread features. It is a Samsung device. I'm very sad about it :( T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Detect Android version
There is an other problem in an other device. It says that SDK_INT=9, VERSION.RELEASE=2.3, but I throws java.lang.NoClassDefFoundError: android.view.InputDevice I can't understan these bugs -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ContentService
Hi, I got the following exception very rarely: Caused by: android.os.DeadObjectException at android.os.BinderProxy.transact(Native Method) at android.content.IContentService$Stub $Proxy.getMasterSyncAutomatically(IContentService.java:765) at android.content.ContentResolver.getMasterSyncAutomatically(ContentResolver.java: 1146) ... 8 more Is it possible that content service isn't available? I checked this value in a thread launched from my activity. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Traceview + performance problem
The adb shell vmstat output is very interesting: When I don't do anything: procs memory system cpu r bfree mapped anon slabin cs flt us ni sy id wa ir 0 0 17788 43468 270420 1975291 1140 0 0 0 99 0 0 0 0 17788 43468 270420 1975266 790 0 0 2 99 0 0 0 0 17796 43468 270420 1975299 970 0 0 0 99 0 0 0 0 17796 43468 270420 1975230 520 0 0 0 99 0 0 When I start my app, and it builds the UI loads data: 0 0 17328 43884 270812 19760 1386 20820 22 0 13 65 0 0 1 0 17328 43884 270812 19760 500 5490 9 0 5 86 0 0 0 0 17328 43884 270812 19760 560 7260 6 0 11 83 0 0 0 0 17320 43884 270812 19760 518 6760 7 0 3 91 0 0 0 0 17320 43884 270836 19760 685 14000 12 1 5 82 0 0 0 0 17304 44088 270888 19764 644 5480 3 0 10 87 0 0 0 0 17260 43884 270884 19768 732 16240 27 0 7 66 0 0 0 0 17260 43884 270884 19768 396 3640 1 0 0 99 0 0 0 0 17260 43884 270884 19768 500 6400 8 0 0 93 0 0 The view is ready, and I scroll the view: procs memory system cpu r bfree mapped anon slabin cs flt us ni sy id wa ir 1 0 17260 43884 270904 19756 1351 17740 40 0 12 48 0 0 1 0 17260 43884 270904 19756 1156 14590 91 0 8 1 0 0 1 0 17260 43884 270908 19760 1357 23280 89 0 8 4 0 0 3 0 17260 43884 270908 19756 1521 18360 82 0 18 0 0 0 1 0 17260 43884 270912 19756 652 13570 90 0 10 0 0 0 5 0 17260 44116 270936 19756 640 12780 78 0 8 14 0 0 1 0 17240 44116 270944 19756 2006 47810 32 0 21 47 0 0 0 0 17180 44112 271032 19756 1117 22660 24 4 4 68 0 0 Why scrolling needs so many CPU-usage? On Jan 18, 9:55 am, b_t bartata...@gmail.com wrote: Hi, my app hasperformanceproblems, and I don't understand why. It has a not too complicated UI, andTraceviewdisplays the following result (a row below an other is it's child): METHOD Incl% Calls+Recur android/os/Handler.dispatchMessage 90.5% 117+0 android/view/ViewRoot.handleMessage 84.8% 7+0 android/view/ViewRoot.performTraversals 83.7% 4+0 --- android/view/View.measure 75.3% 4+5639 android/widget/FrameLayout.onMeasure 75.3% 4+10 android/view/ViewGroup.measureChildWithMargins 75.3% 4+3467 --- android/view/View.measure 75.3% 4+5639 android/widget/FrameLayout.onMeasure 75.3% 4+10 android/view/ViewGroup.measureChildWithMargins 75.3% 4+3467 There is no my class in these calls. Can somebody help me? What should I do to solve this problem? Thanks, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Traceview + performance problem
Hi, my app has performance problems, and I don't understand why. It has a not too complicated UI, and Traceview displays the following result (a row below an other is it's child): METHOD Incl% Calls+Recur android/os/Handler.dispatchMessage 90.5% 117+0 android/view/ViewRoot.handleMessage 84.8% 7+0 android/view/ViewRoot.performTraversals 83.7% 4+0 --- android/view/View.measure 75.3% 4+5639 android/widget/FrameLayout.onMeasure75.3% 4+10 android/view/ViewGroup.measureChildWithMargins 75.3% 4+3467 --- android/view/View.measure 75.3% 4+5639 android/widget/FrameLayout.onMeasure75.3% 4+10 android/view/ViewGroup.measureChildWithMargins 75.3% 4+3467 There is no my class in these calls. Can somebody help me? What should I do to solve this problem? Thanks, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Camera properties
Hi, is there any way to get camera properties without open it? I want to display camera properties but don't want to take a picture. I have to open camera, get properties, then release it: Camera camera = Camera.open(); if (camera != null) { parameters = camera.getParameters(); camera.release(); } And it needs android.permission.CAMERA permission. :( Is there any solution? Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Alarm in sleep mode
Thank you, you answered all of my questions On Dec 29, 10:52 am, Dianne Hackborn hack...@android.com wrote: On Tue, Dec 28, 2010 at 11:56 PM, b_t bartata...@gmail.com wrote: Hmm, so there is no possibility to display real-time information in a widget? For example a compass widget? Correct, app widgets are not intended to be continually refreshing. What is an acceptable refresh rate? Less is better. For polling, I'd suggest 15 minutes. Many times you would be better off doing something push-based, however, such as how gmail gets pushes when there is new mail, causing it to sync, and update any widget as part of that process. And the main question, why does the alarmmanager send alarms in sleep mode when I use RTC instead of RTC_WAKEUP? Because something is still keeping the CPU running. Note the use of the word asleep in the documentation here is somewhat misleading -- it is not talking about the screen being off, but the actual CPU being asleep. -- 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] App launch widget
Hi, I created an application launcher widget, which displays the icon of the selected activity and launch it when you click on it. The only problem with it, that in my phone there is only one application (Compass), which icon cannot be displayed. In an other phone it can be displayed, but Facebook icon can't. Facebook icon is ok in my phone. I tested this widget in the emulator and most of the activity icons can be displayed, but it can't display the Calculator icon (in two test device). But it can display the Calculator icon in my third test device. It is very mysterious. The widget displays icons this way: ComponentName name = new ComponentName(packageName, activityName); Drawable applicationIcon = packageManager.getActivityIcon(name); if (applicationIcon != null applicationIcon instanceof BitmapDrawable) { views.setImageViewBitmap(imageViewId, ((BitmapDrawable)applicationIcon).getBitmap()); } else { views.setImageViewResource(imageViewId, android.R.drawable.sym_def_app_icon); } The packageName and activityName values must be good, because it can launch the selected application. I tried to debug what happens but I couldn't find any error. Application icon is not null, it is a BitmapDrawable, and it has a 48*48 size. Everything looks good, but nothing is displayed. Thanks, Tamás -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Alarm in sleep mode
Hi, In an appwidget I declare a repeating alarm to refresh a widget in every 10 seconds: @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Intent update = new Intent(REFRESH); PendingIntent intent = PendingIntent.getBroadcast(context, 0, update, 0); AlarmManager alarms = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); alarms.setRepeating(AlarmManager.RTC, System.currentTimeMillis(), 1, intent); startUpdateService(context, appWidgetIds); } protected static int refresh = 0; @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); if (REFRESH.equals(intent.getAction())) { refresh++; AppWidgetManager mgr = AppWidgetManager.getInstance(context); ComponentName provider = new ComponentName(context.getPackageName(), getClass().getName()); int[] appWidgetIds = mgr.getAppWidgetIds(provider); startUpdateService(context, appWidgetIds); } } I use AlarmManager.RTC, because I don't want my widgets to be updated in sleep mode. At every update I increase the refresh variable which counts the number of updates. And I display this value in the widget. The phone go sleep mode, and after a while when I use my phone again I realize that the widget was updated in every 10 seconds (because the variable increased in every 10 seconds). What should I do to prevent my widgets be updated in sleep mode? Can I detect somehow that the screen is off, or a phone is in sleep mode? Or the phone wasn't in sleep mode? Why? Thank you, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] PhoneStateListener in widget
Hi, PhoneStateListener works well in an activity but how can I use it in an appwidget? I would like to display signal strength information, but there is no way to get this value (if I'm right), only with using PhoneStateListener. But I don't know how to use it in a widget. Thank you, T. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Alarm in sleep mode
Hmm, so there is no possibility to display real-time information in a widget? For example a compass widget? What is an acceptable refresh rate? And the main question, why does the alarmmanager send alarms in sleep mode when I use RTC instead of RTC_WAKEUP? Thanks On Dec 29, 5:25 am, kernelpanic j.m.roya...@gmail.com wrote: On D?ec 28, 8:00 pm, Mark Murphy mmur...@commonsware.com wrote: On Sat, Dec 25, 2010 at 3:54 PM, b_t bartata...@gmail.com wrote: In an appwidget I declare a repeating alarm to refresh a widget in every 10 seconds: Please don't. yeah really - not on my phone you won't -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en