bgsoft Well-Known Member Licensed User Longtime User Jun 11, 2013 #1 Hello After reading: Android home screen widgets tutorial - part I and part II I have some doubts. I created a widget that checks if the phone is charging through the library Phone with BatteryChanged event. It works perfectly, but if I hold down the menu button and delete applications, and stops entering the service of the widget, although in the event: Service_Destroy, not enter. The only way to re-run the widget service is by clicking the widget icon. My question is: I can pass the focus to the widget to work? is there any way to know that the service is stopped? Other queries about widget: - What is the maximum size of the panel to place the image in a 1x1 widget? if I get over 74, makes a 1 x 2. - The text of witget once put on the home screen, as is done? I put a label below the image but not knowing the measures not go well the letters. thanks Jesus
Hello After reading: Android home screen widgets tutorial - part I and part II I have some doubts. I created a widget that checks if the phone is charging through the library Phone with BatteryChanged event. It works perfectly, but if I hold down the menu button and delete applications, and stops entering the service of the widget, although in the event: Service_Destroy, not enter. The only way to re-run the widget service is by clicking the widget icon. My question is: I can pass the focus to the widget to work? is there any way to know that the service is stopped? Other queries about widget: - What is the maximum size of the panel to place the image in a 1x1 widget? if I get over 74, makes a 1 x 2. - The text of witget once put on the home screen, as is done? I put a label below the image but not knowing the measures not go well the letters. thanks Jesus
bgsoft Well-Known Member Licensed User Longtime User Jun 11, 2013 #2 I found a solution to that deleting background applications do not stop the widget service. In the Service_Start, I again call the service every x seconds. Code: Copy StartServiceAt ("", DateTime.Now + 20 * DateTime.TicksPerSecond, True) [/ code] I would like someone to tell me another way to consume less resources. thanks Jesus Upvote 0
I found a solution to that deleting background applications do not stop the widget service. In the Service_Start, I again call the service every x seconds. Code: Copy StartServiceAt ("", DateTime.Now + 20 * DateTime.TicksPerSecond, True) [/ code] I would like someone to tell me another way to consume less resources. thanks Jesus
Erel B4X founder Staff member Licensed User Longtime User Jun 12, 2013 #3 You can make your service a sticky service: Creating a sticky service - long running background tasks Different devices use different cell sizes. It is not possible to know the actual size. Upvote 0
You can make your service a sticky service: Creating a sticky service - long running background tasks Different devices use different cell sizes. It is not possible to know the actual size.
bgsoft Well-Known Member Licensed User Longtime User Jun 12, 2013 #4 Thanks for your answer. But I still have doubts. a) In some ways I have to know that cell size corresponds to a resolution of a device. b) Where to put the text widget, a label? c) Where I have to put that label to come out centered? (width, height, left and right) d) What type of text I have to put to be the standard of the home screen? I found that if the panel for more than 74 x 74, happens to have more than one cell. This does not allow to put a "normal" text. Attached is a widget image with a rectangle marked in black. Shows that cuts letters. thanks Jesús Attachments Screenshot_2013-06-12-18-16-42.jpg 78.8 KB · Views: 370 Upvote 0
Thanks for your answer. But I still have doubts. a) In some ways I have to know that cell size corresponds to a resolution of a device. b) Where to put the text widget, a label? c) Where I have to put that label to come out centered? (width, height, left and right) d) What type of text I have to put to be the standard of the home screen? I found that if the panel for more than 74 x 74, happens to have more than one cell. This does not allow to put a "normal" text. Attached is a widget image with a rectangle marked in black. Shows that cuts letters. thanks Jesús
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2013 #5 Have you set the CenterWidget property in ConfigureHomeWidget to True? Upvote 0
bgsoft Well-Known Member Licensed User Longtime User Jun 13, 2013 #6 Yes, I did. But if the image is smaller than the panel, and you slide, but put the CenterWidger to true, take the position of Designer. The designer has priority over the code. (I have it checked) Code: Copy rv = ConfigureHomeWidget("layout", "rv", 0, "Avisar USB desconectado",True) thanks Jesús Upvote 0
Yes, I did. But if the image is smaller than the panel, and you slide, but put the CenterWidger to true, take the position of Designer. The designer has priority over the code. (I have it checked) Code: Copy rv = ConfigureHomeWidget("layout", "rv", 0, "Avisar USB desconectado",True) thanks Jesús
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2013 #7 Can you upload a project with the widget layout only? Upvote 0
bgsoft Well-Known Member Licensed User Longtime User Jun 20, 2013 #8 Thanks Erel I copy the layout Greetings: Jesus Attachments widget.zip widget.zip 6.6 KB · Views: 270 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jun 21, 2013 #9 The widget size vs. cells is explained here: App Widget Design Guidelines | Android Developers I think that you are comparing shortcuts with widgets. Most widgets do not have a text with the app name. Upvote 0
The widget size vs. cells is explained here: App Widget Design Guidelines | Android Developers I think that you are comparing shortcuts with widgets. Most widgets do not have a text with the app name.