How to convert psd to android xml file - android

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.

Related

Graphic for Android/iPhone

I'm making a illustrated instruction for how to use an app that will be needed
for Android/iPhone
I'm not much into coding for Android and I though the client just needed the
illustration but he asks:
"We will need the illustration saved to a file that we can run on mobile devices (iPhone/Android) as well as the source code."
Isn't jpg enough? is there some additional code that you android programmers are
aware of?
No. In Android you can just use a Drawable. This can be a number of different file formats, including your jpeg. It may be good to have a look at Android Asset Studio. With this tool you can get a nice zip file for all your different screen densities. If you keep the file structure that asset studio outputs then Android will do all the heavy lifting for you.
It might also help you to know something about 9-patches. This is how Android knows how to resize and stretch your image. Asset Studio has an option to set this as well.

Displaying SVG files in Android

I want to create an app that will display position on some floor plan. Navigation is implementing via WiFi in certain way, I've done it and so now I have a problem of displaying floor plan.
It might be in some vector format, after surfing internet for some time I've decided that it must be svg file.
I found some solutions, but it isn't working for me!
Library svg-android
There is opportunity to display .svg files, but only "simple" files. It works fine only for file in tutorial, but not for any other .svg file (for example, some other file, that you'll create with Inkscape).
So, I decided, that I'll parse .svg file, make DOM from it, somehow get objects and attributes and draw it via OpenGL ES.
Apache Batik
At first glance, very good solution, but there is a problem. Android has some "native" apache libraries and when I try to do something with batik, it throws NoClassDefFoundError, because it's searching not in batik libraries, but in "native" libraries.
Of course, we can add source code in our project, take only batik parser for .svg files and edit it in some way, but there is a lot of work, with same success we can write our own parser.
Tiny Line
There is no trial version, but if we'll see description of how it works for svg files and android, we'll see that there is only rasterization of such files and that's all.
Is there any solution better than writing own parser?
Did anyone come across this problem?
I would suggest using #1. Don't write your own parser. It's just going to be a huge headache.
How detailed does your floor plan have to be? android-svg supports SVG fairly well. It just doesn't have great support for filters or light sources. Your SVG isn't going to have those in them (I hope).
If you don't want to do that, look into quad trees. You can render out a huge image and break that down into a quadtree like format then only load the quads you require.
I have authored an SVG libaray for android the website is
http://www.vectoroid.com
the main thing missing is SVG arc support this is currently fixed and will be in a release in the near future.
I am looking for feedback on it, as i have been working on it for about a year. So if you have any please do tell ...
I've using yet another SVG for Android; seems it is relatively new.
GPLv3, CSS2 support, fonts, texts and spans, linear and radial gradients, SVG and SVGZ, initial filtering support, images from assets, from web and inline base64-encoded images. Fastest from all I've tried.
Of course filters support might be better, but except this it works well and even displays 20-megabytes SVG files.
Successfully tested these 2 libraries:
https://github.com/BigBadaboom/androidsvg - Apache License 2.0
https://scand.com/products/svgkit-android/ - needed tweaking to compile with modern SDK (suppress warnings, update gradle file); LGPL / commercial
androidsvg looks better so far.

Android game Image format

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

2D tile game map storage

I'm new to game programming, and am trying to write the Map storage portion of my 2D tile based game on android. At first, my plan was to store the maps in XML. I found a tool (http://www.mapeditor.org/) that stores the created maps in a format close to what I was thinking. However, it seems like Android is very limited when it comes to XML. I'm used to working with XML Beans which doesn't work on Android, though I admit XML Beans would probably be too resource heavy for mobile devices anyways. However, after searching around for XML parser options, it seems like even basic XML validation isn't even included by default with the Android SDK. It's starting to look like XML might not be the best answer.
Does anyone know of a good standard way to store map configuration besides XML? Or some strong XML tools available in Android that handle validation (against a defined schema), and preferably simple parsing? I would really like to avoid defining my own flat file text format for maps...
Check out AndEngine. If I remember correctly AndEngine already has the classes needed to load a map from an XML file for rendering.
As far as a standard way to store map configurations, I would say XML is the way to go. I mean you could create your own format, but why re-invent the wheel?
I parse XML in Android with javax.xml.parsers.DocumentBuilderFactory and various other XML parts. It hasn't failed me yet!
For example see: http://www.developerfusion.com/code/2064/a-simple-way-to-read-an-xml-file-in-java/

Convert PSD to Android XML (layout) Format?

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.

Categories

Resources