Graphic for Android/iPhone - android

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.

Related

How to convert psd to android xml file

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.

Tesseract character recognition problems in Android (but not on iOS?)

I've build an application that uses Tesseract (V3.03 rc1) to identify some specific text strings. These are, unfortunately, printed on a custom font that requires that I build my own traineddata file. I've built the application on both iOS (using https://github.com/gali8/Tesseract-OCR-iOS for inspiration) and Android (using https://github.com/rmtheis/tess-two/ for inspiration as well).
The workflow for both platforms is as follows:
I select a bounding box on the preview screen for where I can crop out the relevant text, and crop the image accordingly.
I use OpenCV to get a binary image (using OpenCV's adaptive threshold function with the same parameters for both platforms)
I pass this binary image to Tesseract. Both platforms (Android and iOS) use the same traineddata file.
And yet, iOS recognizes the text strings perfectly, while Android keeps misidentifying certain characters (6s for Ss, As for Hs).
On both platforms, I use the same white list string, I disable load_type_dawg and load_system_dawg, and also choose to save the blob choices.
Has anyone encountered this kind of situation before? Am I missing a setting on Android that's automatically handled in iOS? Is there something particular about Android that hasn't crossed my mind?
Any thoughts or advice would be greatly appreciated!
So, after a lot of work, I found out what was wrong with my Android application (thankfully, it wasn't an issue with Tesseract at all). As I'm more familiar with iOS apps than Android, I wasn't sure how I could load the traineddata file onto the application without requiring the user to have the file loaded on their external storage device. I found inspiration in this project (http://www.codeproject.com/Tips/840623/Android-Character-Recognition), as they autoload the trained data file.
However, I misunderstood how it worked. I originally thought that the TessDataManager did a file lookup on the project's local tesseract/tessdata folder in order to get the trained data file (as I do this also on iOS). However, that's not what it does. It, rather, checks the internal file structure (data/data/projectname/files/tesseract/tessdata/traineddatafilegoeshere) to see if the file exists and if it doesn't, it copies over the trained data file it keeps in the Resources/Raw directory. In my case, it defaulted to the eng file, so it never read my custom font file.
Hopefully this helps someone else having similar issues. Thanks to Robin and RmTheis for all of your help!

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

Android vector graphics icon set

Anyone have a handy link where I can download the full Android vector-based icon set?
They're not super well organized, but you may already have them in your android-sdk/ directory (assuming you've downloaded your Android docs locally through your AVD Mannager).
Either in your:
docs/shareables/
icon_templates-v1.0/
icon_templates-v2.0/
sample_images/
search_icons/
(they all seem to be in Adobe Photoshop .psd format
stored in different layers)
or in your
docs/assets/images/
For their appendix, take a look at the local copy of your docs (here is the online copy)
docs/guide/practices/ui_guidelines/icon_design.html
would this be what you are looking for
http://www.matcheck.cz/androidguipsd/

Categories

Resources