I am coding an Android App for a research project at my institution, and have been working with a designer who has rendered some attractive UI mockups in Photoshop (using CS5). I'd like to implement her designs as layouts for my Android application, and this would be WORLDS simpler if there were some way I could convert the files to XML format. I think it's rather counter-intuitive that PS offers android templates, but no real way to apply these in the android design/layout process, short of (attempting to) mimic her artwork in XML code, which I cannot do by any stretch. Is this conversion possible? Is there something I am missing?
Thanks
~Taichou
I'm not aware of any such tool.
But you can approximate it by slicing up her mockups and using them in your GUI like you would convert a website template from an image to HTML.
As long as her layouts aren't too terribly complex you should be able to get by with flow layouts or relative layouts.
Right click - properties - Background (in Eclipse layout design) might be what you're looking for, but remember a bitmap image won't look the same on many devices with different screen resolutions.
Related
How to convert psd image to xml code to reducing size of android application and work effectively and android xml design improve to application performance fast.
you can use these software for convert the psd to xml
http://www.psd2androidxml.com/
2nd is you can use the png file to drawable folder and use it
There are some ways to achieve this.
One way is to watch tutorials and learn how to do it by yourself.
The second way is to use some automated online tools, however they are not reliable, and you will have to correct the code manually.
The site that was mentioned by Nirav Shah, www.psd2androidxml.com, is a service, not a software. You send the PSD files to them, and they hand code them according to your specifications. It may cost more than the previous two solutions, but the result is better compared to automated online tools.
I found a lot of free templates in PSD format for android here. How do we actually incorporate these templates into our applications? Could I have some pointers?
Templates are used by and large for mocking layouts. Generally you have to build the layouts in XML by hand using a composition of existing widgets, bitmaps and drawables.
So you would need to create or extract the bitmaps you want from the PSD templates and incorporate these.
As I said though, a lot of templates are just used for mocking designs, and you might not find them easy to slice and dice.
I'm a designer/developer learning Android after a year spent developing on iOS.
iOS's equivalent of NinePatch/9patch is called resizableImageWithCapInsets. It allows the developer to take a regular PNG and programmatically specify the 9patch information -- that is, the info that goes in the 1-pixel border around a .9.png file for Android.
But with one key difference. On Android, the bits in the middle of the 9patch are scaled, whereas on iOS they're tiled. For some types of images this doesn't matter; but for anything with a texture or pattern scaling destroys the image.
Specifying the regions programmatically also allows designers use of tools like http://macrabbit.com/slicy that split a complex, master Photoshop files into individual image assets; as far as I can tell there aren't currently equivalent tools for Android 9patches. (The draw9patch tool that comes with the SDK doesn't work because you'd have to reuse it every time you exported from the main Photoshop file.)
I'm guessing one could create a Drawable subclass that mimics the iOS behavior: you pass it a plain old PNG and a set of 9patch dimensions and it draws itself appropriately, tiling the middle sections. You could even provide a switch to toggle between tile and stretch (which I wish iOS did).
As a newbie it'd take me some time to figure out how to do this. Does something like it already exist as an open source component or sample?
Thanks!
I have a problem with an image for an android game. The problem is not a problem with the code because the code that I use I took from a book (Beginning Android 4 Games Developer).
The problem is this: I know the format that I have to use in android: png, but I don't know the settings for this format that I have to use (like RGB565...). Because if I use simply png, when I run the game the images are not good. So I need someone to explain to which settings I need to use for images for android games.
P.S The software that I used is photoshop. If there is better software for this purpose tell me.
I think there is a strong misconception in your understanding of Android and how it implements graphics. You are not constrained to .png for nearly any of your development. The .png and .9.png are only enforced strictly for managing drawable constants.
Android uses Java and has the capability to utilize nearly any graphical format. In particular native support for .bmp, .png, and .jpg are present for every device and Android OS version. You may even create your graphics in realtime byte by byte.
As for a good image editor, there are a number out there. I often use a combination of GIMP and Photoshop, myself.
Hope this helps,
FuzzicalLogic
I am investing some time doing drawables for an Android project and I am looking for alternatives.
Currently I do them on Adobe Illustrator and with some drawables I can use Android Asset Studio (e.g. drawables for the action menu). The problem with Android Asset Studio is the lack of possibilities to use my own color (we can only use white/black colors).
I wanted something like Android Asset Studio where I can give him a HD image and he creates all drawable sizes. Is that possible?
Another option could be a program/script that could allow me to say "I want to scale to these resolutions" and he does it for all images.
What you're looking for is called a batch resizer, but without knowing what you're working with, it's hard to give a recommendation. For instance, you can use both Photoshop and Gimp for it. I believe Gimp will require a plugin, while Photoshop has the script built-in.