Android :: How To Implement Multiple Sizes In Widget?
Dec 7, 2009I have noticed that when I install some widgets I can later choose from different widget sizes while adding widget. How can I implement that feature in my widget?
View 2 RepliesI have noticed that when I install some widgets I can later choose from different widget sizes while adding widget. How can I implement that feature in my widget?
View 2 RepliesWhat I'm trying to do is have a clock widget of different sizes (i.e. 2x2, 3x3, 4x4 etc) in one apk and a configuration activity to be able to select which size to add. From what I've learned from documentation:
Widget size is specified in <appwidget-provider> tag in respective xml file
Also in that file I set up the configuration activity for that provider
So it seems that size is a property of AppWidgetProvider and I'll need to somehow create another provider from the code in configuration Activity of the first one. I have read this and this. First one explains how to put multiple wigets in one apk, but it's not clear how to select between them in runtime. Second one is about changing layouts, but not size.
I've been reviewing the Supporting Multiple Screens documentation on the Android and I just need some additional clarification...
It's my understanding that designing three unique interfaces (ldpi, mdpi, and hdpi) would be the best way to go about supporting all the potential android screens with minimal scaling/distortion.
Yes, I know there are similar questions posted, however... If I create an image for the benchmark mdpi (let's say my image is 300x210, just for example) how to I determine what size I will need to recreate that image at ldpi & hdpi? This post as well as a google search leads me to believe that ldpi is just 75% of the mdpi image, and the hdpi is 150% of the mdpi image. Is this accurate?
I have created layout-large and testing against android 2.0.1 WVGA. however, its picking layout-normal. Can anybody suggest me what I am doing wrong. Even though, I have 3 layouts ( layout-normal, layout-large, layout- small), Its always picking layout-normal. why its so.
I added properties to manifest file
CODE:.............
I'm looking at creating an AppWidget and want to have the user select which size they want before adding it. Thus, the user can choose 1x1, 2x2, etc. The Calendar widget in Android 2.2 (and possibly earlier, but not in 1.6) does this. How is this done?
View 11 Replies View RelatedI am currently trying to make my app compliant with all screen sizes / api levels. I have this mostly working, however there is 1 issue i cannot resolve: Layouts in the "layout-hdpi" folder are used by and any phone on 1.5 (API level 3). - Which i dont want, i want API level 3 phones to use the "layout" folder. So to resolve this I added "-v4" onto the folder also, this works, the folder is no longer used by 1.5 phones. However, now the folder is also not used on API Level 6 phones, for example the droid. The droid only picks up the folder if i name the folder: "layout-hdpi-v6". (Also if i put "-v3" on a folder, the layout folder is not used by API level 4 phones) My understanding is that the -v<api level> qualifer allows you to exclude phones on an API level that is too low, so -v4 should mean that the folder will be used by all phones on API level 4 and above. I am finding a folder is only used for that specific API level. Has anybody else ran into this same issue? And does anybody know of any possible solutions?
View 3 Replies View RelatedI've read the Android documentation:
http://developer.android.com/guide/practices/screens_support.html
but still have some questions. I'm trying to design a music application which basically has images of the instrument (ImageButton) that play a sound when clicked. However, I'm confused about how to have the ImageButtons scale to fit all the different screen sizes and how to position them.
Which layout is best used for needing to position ImageButtons in specific locations on the screen? (i.e. cymbals on a drum set) FrameLayout, RelativeLayout? If I only really care about medium and large screens, do I need to create different resources (images) for both as well as a different XML layout to position them? I'm trying to find the simplest way to do this without having to create a separate layout XML file for positioning/size and separate image resources for each screen.
I want to create an app widget that could take up a different number of "cells" on the home screen, but I don't think that the app widget framework easily supports this. I know that an app widget can have a configuration screen, and I'd like the user to be able select a sort of small, medium, or large size for the widget as part of my configuration activity. Unfortunately, I don't think that this is possible, correct? Based on the minWidth and minHeight properties, the Launcher app will assign a number of cells that I can't configure at run time.
For instance, if I want a weather widget that has a current, hourly and weekly format that take up 1, 2, and 4 cells respectively, I can't do this at run time. Instead, I believe my only option is to export 3 different widgets and have them all listed in the widget picker dialog as something like "Weather - current conditions", "Weather - hourly forcast", and "Weather - week long forcast".
What are the 4x1 app widget sizes for WVGA and FWVGA in both portrait and landscape?
View 9 Replies View Relatedi am developing a game and i need to use android1.5 only.
i wrote sample application using 1.6 and kept drawable-hdpi,-ldpi ... and application is working fine in emulator of 1.6. i made apk and opened an emulator (android 1.5) from command prompt application is also working fine.
in 1.6 if i change emulator resolutions the application UI is resizing. but in 1.5 emulators not.
is that mean, the application developed in android 1.6 runs in 1.5 emulator but multi screen support is not achieved?
..."how to achieve multiple screen sizes in android 1.5". multiple screen support is available from 1.6.
I'm confused regarding the densities. I see that with medium density, the screen resolution could be either 320x480, 480x800, or 480x854. So if I have an image thats 300px wide in the mdpi folder, how is it going to look the same size on all 3 different screen sizes (mainly 320x480 vs the other 2)? And by look the same size, I mean scale to be bigger or smaller depending upon the screen size.
View 5 Replies View RelatedLet's say I have MyActivity and inside my onCreate method I initialize MyBackgroundView, then MyPlayer1View then MyPlayer2View. I want to be able to touch the screen, figure out if I have touched Player1 or Player2 and then respond with changes to the players if I have touched them.
My problem is, where do I put the onTouchListener? Can only MyBackgroundView listen for touches, or can the players listen for touches too? If MyBackgroundView can only accept touches, do I need to call view.ontouchlistener that says, you have touched me, and I have a player at those coordinates, so I'll pass the motion event to the player and let it handle it? Or do call view.ontouchlistener in each of the players that says, you've touched me, now I will react to the motion event?
In 1.5 doc about app widget , A RemoteViews object can not support the EditText classes. so we should think some method . today ,I have write a demo and gone through the Android Source Code and find some way from web. at present,there is not good idea to implement EditText on widget.
View 2 Replies View RelatedI am just getting started with Android development and I have created a nice little widget that displays some info on my home screen. However, I now want to implement a Button on my widget that updates the info in my widget TextView.
View 3 Replies View RelatedI try to create a widget and I am now wondering how to be able to put a button on my widget and set its "onClickListener". It seems that we are limited to the RemoteViews... OK I can deal with that (but this is a limitat to me) but I'd like to add a button where the user can request an update on the data displayed in the widget. (I get some info on the web but the user only needs to request an update, I can't defined an automatique update, it's useless for my app) I'm sure we can do that since there is an example with a player and obviously with a PLAY/PAUSE button. I was looking for in the remoteViews API btu without finding anything.
View 3 Replies View RelatedI would like to implement a time settings wheel widget like the one iPhone has (http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/art/ui_datetimepicker.jpg). Should I use GlSurfaceView or just extend View? Should I make it as a compound View (it would consist of several Views) or draw everything on the Canvas in onDraw? In case I won't extend GlSurfaceView, how to do (smooth) animations? Start a Thread and call postInvalidate()?
View 1 Replies View Relatedcan anybody give example how to implement click event in appwidget in android ?
View 1 Replies View Relatedhow implement android's Gallery fling action (with the animation) in my own widget?
View 4 Replies View Relatedall my contacts are google contacts with several linked to Facebook accounts.When I access my contacts through the People widget, all's good, I only see the google contacts (I've deselected Facebookers in the view menu). However when I access the Messages widget all my contacts are doubled up for some reason. I realise this list is also showing facebook contacts as well as google contacts but even the non-facebook contacts are doubled up.
View 1 Replies View RelatedI've just switched to launcherpro from sense, and the one thing I miss is the news widget. On sense in had three full page widgets devoted to it, and I need a replacement! Requirements are:
Full page widget
Multiple homescreen support
Simple aesthetics
Customisable news feeds
I am looking for a Twitter client for Android that can ...
1. Handle multiple accounts
2. Display multiple accounts on the widget
I like Seesmic but the widget is just too small for my taste. I can only see the very last tweet. It would be nice to have a widget where either tweets from multiple accounts are combined or there is the option to switch between the accounts quickly directly from the widget. Any suggestions?
I'm trying to implement a Select All menu item for a ListView in a ListViewActivity. The relevant parts of my ListViewActivity: public class MyListViewActivity extends ListActivity browsed around stackoverflow.com and the google; the above is something that should work. But it isn't. setSelection(i) appears to be the method I want to call on ListView but it's not working as advertised. What am I doing wrong? Is this even possible on Android in code?
View 2 Replies View RelatedI am learning the app widget programming in the 1.5 SDK release. I was playing with the sample widget (wiktionary) and found out that you can actually add multiple instance of the same widget to the home screen, is there a way to prevent this? An attribute in the XML? I am stuck with 3 instance of wikitonary and 2 instances of music player on my emulator now... can't get rid of them... :(Also I am looking into buliding my own app widget container, not a home screen replacement, just a container that can host other widgets, I read the appwidgethost api doc, is there any sample code or guide on how to use the appwidgethost api
View 3 Replies View RelatedI am wondering is there any way to create something similar to spinner but which allows multiple selection. I guess we can select multiple entries from ListView but I don't have much space to show all the entires and also I need to show three different categories on the same Activity which you can select from.
Here is what I want to do:
Category 1:
Category 2:
Category 3:
OK, here goes my first post.
I have the calendar syncing with my gmail calendar, which has multiple calendars inside (mine, my wifes, ours, baseball schedule, cavs schedule, etc..)
I also have the stock "mail" (not Gmail) application syncing with my exchange at work.
Since I got 7 home screens to work with, I wanna put my Gmail calendar on home screen #1, and my exchange calendar on home-screen #7. Sort of a seperation of home and work
So I put the stock widget on home-screen#1, and again on home-screen#7. But a widget is basically just a frontend for an app running in the background. When I go to home-screen#1 and select MINE, WIFES, and CAVS.......that selection affects the widget on home-screen #7 as well. I go to screen #7, tell it to display Exchange only.......and when I go back to #1, it is switched to exchange.
So.....any way to do what I want?
1) Have a calendar on home-screen#1 that shows my Gmail calendar(s)
2) Have a calendar on home-screen#7 that shows my Exchange calendar
Does anyone know if there is a widget that will remember multiple wifi connection so I don't have to input a code each time I switch to a different connection.
View 4 Replies View RelatedI've got a quick question about screen size support. Currently, I've got an application that is rockin' along just fine on 1.5 and 1.6. Today the client called and says they want to run on Droid. While I've downloaded the 2.0 SDK, I'm a little wary of compiling against it. Will it break 1.5 and 1.6 compatilbility? How will the "medium" phones (G1, MyTouch) know to use those layouts?
View 3 Replies View RelatedI want to develop an application for a tablet of 480*800 screen pixels. I had developed an application for normal mobiles, but now this screen size is large than normal size. what precaution should I take while developing the application? Because device is not available right now so I must have to work on the project using emulator.
View 2 Replies View RelatedG1, Dream, Magic, Hero, Galaxy and more to come... Does anybody have a rundown of their screen sizes (and of some of the devices to come out)?
View 2 Replies View RelatedHello, I would like to ask what settings are necessary for my application to be available on all screen sizes: Is it enough to compile it using SDK 1.6 (but target is set to 1.5 and API level to 3) or maybe I have to set target to 1.6 and API level to 4?
View 4 Replies View Related