android: checkbox, radiobutton image resources - android

I am looking for the image resources that are used on my android device(s). I have one device running Froyo (Platform version 2.2.1, API Level 8, Samsung Galaxy tab) and one running Homeycomb_MR2 (Platform version 3.2, API level 13, Motorola Xoom). With help from this post I was able to locate image resources...
The problem is that for my Froyo device, the resources in "...platforms\android-8\data\res\drawable-hdpi\ and ...\drawable-mdpi\" do not look like the check boxes or radio buttons I see on screen. Specifically, the widgets I see have a larger green fill circle in radio buttons and checks that extend outside the box for check boxes. Can anyone explain why I can't find the resource images I am seeing on screen? Are these widgets getting displayed using some other images?

The resources that your see in your res folders are overridden by the system resources.
Let me give you an example :
The spinner will look differently on the emulator and that on your galaxy tab. As samsung has made changes in the Android os as per its requirement and overriden the controls for optimising its look

Related

Android Panel Style (Card UI) in Jelly Bean are they usable?

aI have been looking at the stock apps on my Google nexus running Jelly Bean, and there are some nice panel styles I would like to use in my own App I was wondering if they are part of the stock UI elements that are available to use?
Here's a screenshot of the panel I'd like to use:
This screenshot is taken from the Google Maps apps but can be seen in other applications, it has a thin grey border and the bottom border is slightly thicker. Some panels have rounded corners, some I've seen have square corners.
No, this is not a standard widget.
You can however choose a library which provides these (or equivalent) widgets:
Cardslib
Cards-UI
Also, you could try to see if some of the 9 patches (*.9.png) which are in the folder (on Windows):
C:\Program Files\Eclipse\adt-bundle-windows-x64\sdk\platforms\android-16\data\res\drawable-mdpi
May help you in your design.
The part in bold is to be replaced by your installation path.
I indicated API level 16, but you can choose among all the ones you have installed
And, of course, you're not limited to look into the mdpi folder. That's just the DEFAULTone.
If anyone finds this question, right now you can use CardView to make cards like the ones shown in the picture.

Designing android app for multiple screen sizes

I'm designing an android app with a minimum SDK version of 8. I have currently been testing it on a emulator running an about 4 inch phone...
I recently got a Nexus 7 and ran it on that. I thought it would just enlarge the screen (button and text including) so it was basically magnified... it wasn't
I thoroughly googled it and came up with using different layout sizes (I am using Eclipse by the way) so I made a 'layout-large' folder but I got the following error and no design view of the screen layout would show
'It looks like you are using a render target where the layout library does not support the tvdpi density.
Please try either updating to the latest available version (using the SDK manager), or if no updated version is available for this specific version of Android, try using a more recent render target version.
Exception raised during rendering: Index: 2, Size: 2
Exception details are logged in Window > Show View > Error Log'
How can I solve this? I don't want to change the minimum SDK from 8
The tvdpi seems to have been implemented in Android 3.2 (meaning SDK level 13). If you want to target the Nexus 7 displays, with alternate resources, I suggest targeting large screens instead of tvdpi. You shouldn't have to change your minimum requirement of SDK level 8 as it doesn't make sense to target TV densities when aiming for Nexus 7, but maybe that's just me.
There is another similar question here on Stackoverflow with a great answer: How to create different layout for Galaxy S3 and Nexus 7?
Also visit the Android developers design guidelines and specifically Designing for Multiple Screens for more information. The Android guidlines is a very good website that I use consistently.
First thing first, there is great information at developer.android.com about programming for different screen sizes. Fragments are great for this. Did you get rid of the 'layout' folder. It sounds from your question you just renamed the layout folder. I would start by reading at a lot at the Android developer information center. Check the first link.

How to emulate Nexus 4?

Is it possible to create an AVD to emulate the Nexus 4?
I am using Eclipse and I'm pretty sure I have updated all of the SDK tools etc, along with the 4.2 SDK/system Image etc.
However, when I open the AVD manager to add a new AVD, there no longer seems to be the ability to enter a custom resolution/density etc. There is a droplist containing several devices, but no Nexus 4, and no generic version with a resolution of 768x1200.
Am I just missing something obvious?
Thanks in advance for any help!
After Update your ADT to version 21.
In Older Version each time you have to set Add Custom Screen if you want custom Device Configurations as (if you want Nexus 4).
In ADT21 version you can get this thing done by
open AVD Manager, u can define your custom screen in "Device Definition"
Alternative (Much Easier approach)
in Newest Version you Don't Need to Set Custom Device
Configurations from the above Suggestion as much easier way is available for it. you >Just Have to Make Emulator With your Device
Configurations and after you will see those Configurations with
Emulator Name Inside Graphical Layout of XML
like after Created my Emulator of Nexus7 Emulator with Android 4.2 with Name as "Nexus7_Android_4.2" i will get this Device Configuration in Graphical Layout of xml automatically.
Below is the Screen Shot of it.
Hope it will Help you.

How to load right layout in emulator?

I have two folder res/layout and res/layout-sw600dp. When I try to run my app in Tablet Emulator 7 inch (1024x600) I see on screen layout from res/layout. How to see another layout for tablet from layout-sw600dp in Emulator?
Double click the layout you want to open or choose a different setting from the drop down menus and the relevant layout will be loaded. e.g Nexus One, Nexus S etc
Add a custom layout in this menu if the defaults do not suit your devices.
To see these layouts at runtime you need to run your app on a device\emulator that matches the layout settings.
To be able to see both layouts, you will need to use different Android Virtual Devices (AVD's), or in other words, a different Emulator. The android documentation has a page dedicated to managing AVD's.
The android development team has provided a tool that you use to create AVD's called AVD Manager. I believe that you have used it, because to be on an emulator means that you have already created one!
You can find it in Eclipse in the following location:
Window -> AVD Manager
To actually see the different layouts between the different emulators, you will need to configure them differently, to accurately represent the device you want to target. You should be able to tweak the Hardware options to make your emulators behave differently. You can find a list of hardware options here.

Android views' borders issue on some devices

TOPIC Solved: Answer below.
Some users have been reporting border alignment issues on some android components such as the alert popup or the editTexts. This is happening on the Samsung Galaxy Apollo (200x400) and the HTC Pro Touch (480x640) devices. I cannot replicate that because i don't own those devices and in the Samsung Galaxy S and emulator everything looks just right.
I think that the problem is the dpi or resolution of the device (because the edittext background is a single .9.png so image should look ok); however I am not sure if the supports-screens tag is the solution. Also, application was developed using Api 3 (v1.5) and supports-screens was not yet supported, nor the screen-size resource qualifier.
The style used for the alerts and editText is the phone default. Could the problem be something related with the theme applied to the phone by the user?
Thanks in advance!, I show some images given to me showing the problem:
It might actually be the display density causing this. If you don't provide assets in the appropriate density, the framework will try to rescale your images, including 9patches. Unfortunately there's no real perfect way of resizing 9patches and it can sometimes lead to artifacts, although I would be very surprised if it caused the type of artifact you are seeing.
I've had the same problem and the solution was changing the font size of the TextView from 16px to 17px (or any other odd number).
Well it really was the resolution/density. I managed to create an emulator with the WQVGA density (which needed > Android 1.6) and replicate the error.
The solution is seen on the Supporting Legacy Applications section of the Android Developers webpage: http://developer.android.com/guide/practices/screens_support.html. So a newer version of the API is needed in the project but it still holds support for the 1.5 version.
Thanks.

Categories

Resources